]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0034-USB-isight-fix-kernel-bug-when-loading-firmware.patch
ed02f1e3b28c60020a5a9928f3a490d914b13039
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.1 / 0034-USB-isight-fix-kernel-bug-when-loading-firmware.patch
1 From 1d24cdb0797a26e1fb1d3545f6d4b992a5a23e96 Mon Sep 17 00:00:00 2001
2 From: Greg Kroah-Hartman <gregkh@suse.de>
3 Date: Mon, 5 Dec 2011 14:02:59 -0800
4 Subject: [PATCH 34/49] USB: isight: fix kernel bug when loading firmware
6 commit 59bf5cf94f0fa3b08fb1258b52649077b7d0914d upstream.
8 We were sending data on the stack when uploading firmware, which causes
9 some machines fits, and is not allowed.  Fix this by using the buffer we
10 already had around for this very purpose.
12 Reported-by: Wouter M. Koolen <wmkoolen@cwi.nl>
13 Tested-by: Wouter M. Koolen <wmkoolen@cwi.nl>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 ---
16  drivers/usb/misc/isight_firmware.c |    6 ++++--
17  1 files changed, 4 insertions(+), 2 deletions(-)
19 diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c
20 index fe1d443..8f725f6 100644
21 --- a/drivers/usb/misc/isight_firmware.c
22 +++ b/drivers/usb/misc/isight_firmware.c
23 @@ -55,8 +55,9 @@ static int isight_firmware_load(struct usb_interface *intf,
24  
25         ptr = firmware->data;
26  
27 +       buf[0] = 0x01;
28         if (usb_control_msg
29 -           (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\1", 1,
30 +           (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, buf, 1,
31              300) != 1) {
32                 printk(KERN_ERR
33                        "Failed to initialise isight firmware loader\n");
34 @@ -100,8 +101,9 @@ static int isight_firmware_load(struct usb_interface *intf,
35                 }
36         }
37  
38 +       buf[0] = 0x00;
39         if (usb_control_msg
40 -           (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\0", 1,
41 +           (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, buf, 1,
42              300) != 1) {
43                 printk(KERN_ERR "isight firmware loading completion failed\n");
44                 ret = -ENODEV;
45 -- 
46 1.7.7.4