summaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/gtco.c
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2007-03-19 10:26:32 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2007-04-27 13:28:36 -0700
commit1b55fa2d430d6c708d3e5efbc6134be4a0c32b15 (patch)
treecb512cfbd98b12e53ed5f638bb77312a2c4dfd6e /drivers/usb/input/gtco.c
parentf81ee4d52880b08c213982df5041217212689960 (diff)
USB: gtco.c: fix a use-before-check
NULL checks should be before the first dereference. Spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/input/gtco.c')
-rw-r--r--drivers/usb/input/gtco.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/input/gtco.c b/drivers/usb/input/gtco.c
index 203cdc1bbba..ae756e0afc9 100644
--- a/drivers/usb/input/gtco.c
+++ b/drivers/usb/input/gtco.c
@@ -1047,13 +1047,10 @@ static void gtco_disconnect(struct usb_interface *interface)
/* Grab private device ptr */
struct gtco *device = usb_get_intfdata (interface);
- struct input_dev *inputdev;
-
- inputdev = device->inputdevice;
/* Now reverse all the registration stuff */
if (device) {
- input_unregister_device(inputdev);
+ input_unregister_device(device->inputdevice);
usb_kill_urb(device->urbinfo);
usb_free_urb(device->urbinfo);
usb_buffer_free(device->usbdev, REPORT_MAX_SIZE,