[PATCH 29/78] USB: gtco.c: fix a use-before-check
Greg Kroah-Hartman <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
From: Adrian Bunk <[email protected]> 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 | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/usb/input/gtco.c b/drivers/usb/input/gtco.c index 203cdc1..ae756e0 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, -- 1.5.1.2 ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel