projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f81ee4d
)
USB: gtco.c: fix a use-before-check
author
Adrian Bunk
<
[email protected]
>
Mon, 19 Mar 2007 09:26:32 +0000
(10:26 +0100)
committer
Greg Kroah-Hartman
<
[email protected]
>
Fri, 27 Apr 2007 20:28:36 +0000
(13:28 -0700)
NULL checks should be before the first dereference.
Spotted by the Coverity checker.
Signed-off-by: Adrian Bunk <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/usb/input/gtco.c
patch
|
blob
|
history
diff --git
a/drivers/usb/input/gtco.c
b/drivers/usb/input/gtco.c
index 203cdc1bbba442806b29d90806be6a20dafb5c03..ae756e0afc996fd5d50d1192a7c062bc3a38145f 100644
(file)
--- 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,