NULL checks should be before the first dereference. Spotted by the Coverity checker.
Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]> --- --- linux-2.6.21-rc3-mm2/drivers/usb/input/gtco.c.old 2007-03-19 09:29:44.000000000 +0100 +++ linux-2.6.21-rc3-mm2/drivers/usb/input/gtco.c 2007-03-19 09:30:31.000000000 +0100 @@ -1047,13 +1047,10 @@ static void gtco_disconnect(struct usb_i /* 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, ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel