USB: isight: fix kernel bug when loading firmware
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Dec 2011 22:02:59 +0000 (14:02 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 10 Dec 2011 00:18:19 +0000 (16:18 -0800)
We were sending data on the stack when uploading firmware, which causes
some machines fits, and is not allowed.  Fix this by using the buffer we
already had around for this very purpose.

Reported-by: Wouter M. Koolen <wmkoolen@cwi.nl>
Tested-by: Wouter M. Koolen <wmkoolen@cwi.nl>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/isight_firmware.c

index fe1d44319d0a1eb2d373c14c6fccbfdfedd505c9..8f725f651915437bd46562067e9169d7e8873dd9 100644 (file)
@@ -55,8 +55,9 @@ static int isight_firmware_load(struct usb_interface *intf,
 
        ptr = firmware->data;
 
+       buf[0] = 0x01;
        if (usb_control_msg
-           (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\1", 1,
+           (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, buf, 1,
             300) != 1) {
                printk(KERN_ERR
                       "Failed to initialise isight firmware loader\n");
@@ -100,8 +101,9 @@ static int isight_firmware_load(struct usb_interface *intf,
                }
        }
 
+       buf[0] = 0x00;
        if (usb_control_msg
-           (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\0", 1,
+           (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, buf, 1,
             300) != 1) {
                printk(KERN_ERR "isight firmware loading completion failed\n");
                ret = -ENODEV;
This page took 0.046155 seconds and 5 git commands to generate.