USB: sisusbvga: Fix bug
authorSatyam Sharma <satyam@infradead.org>
Sun, 2 Sep 2007 20:07:31 +0000 (01:37 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Oct 2007 21:55:25 +0000 (14:55 -0700)
drivers/usb/misc/sisusbvga/sisusb.c: In function sisusb_open
drivers/usb/misc/sisusbvga/sisusb.c:2444: warning: sisusb is used uninitialized in this function

is a genuine bug (which will cause oops). We cannot use "sisusb" in
error path for (!interface), because sisusb will itself be derived
from "interface" later.

Signed-off-by: Satyam Sharma <satyam@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/sisusbvga/sisusb.c

index 4d6b89336e6332aef22483a8cf26b6143d9d3863..033bdfe9b215e27685fe59fa551d0e6313dee7e5 100644 (file)
@@ -2440,10 +2440,8 @@ sisusb_open(struct inode *inode, struct file *file)
        struct usb_interface *interface;
        int subminor = iminor(inode);
 
-       if (!(interface = usb_find_interface(&sisusb_driver, subminor))) {
-               dev_err(&sisusb->sisusb_dev->dev, "Failed to find interface\n");
+       if (!(interface = usb_find_interface(&sisusb_driver, subminor)))
                return -ENODEV;
-       }
 
        if (!(sisusb = usb_get_intfdata(interface)))
                return -ENODEV;