Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b55fa2d430d6c708d3e5efbc6134be4a0c32b15
Commit:     1b55fa2d430d6c708d3e5efbc6134be4a0c32b15
Parent:     f81ee4d52880b08c213982df5041217212689960
Author:     Adrian Bunk <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 19 10:26:32 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:28:36 2007 -0700

    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 <[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,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to