Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
USB: isight: fix kernel bug when loading firmware
Browse files Browse the repository at this point in the history
commit 59bf5cf upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
gregkh authored and Tapani- committed Oct 25, 2013
1 parent a6ddda3 commit 220457f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/usb/misc/isight_firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 220457f

Please sign in to comment.