]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.20.2/usb-hid-fix-usb-vendor-and-product-ids-endianness-for-usb-hid-devices.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 2.6.20.2 / usb-hid-fix-usb-vendor-and-product-ids-endianness-for-usb-hid-devices.patch
1 From stable-bounces@linux.kernel.org Sun Feb 11 09:28:13 2007
2 From: Julien BLACHE <jb@jblache.org>
3 Date: Sun, 11 Feb 2007 18:27:09 +0100 (CET)
4 Subject: USB HID: Fix USB vendor and product IDs endianness for USB HID devices
5 To: stable@kernel.org
6 Cc: Julien BLACHE <jb@jblache.org>
7 Message-ID: <Pine.LNX.4.64.0702111825170.22290@jikos.suse.cz>
8
9 From: Julien BLACHE <jb@jblache.org>
10
11 [PATCH] USB HID: Fix USB vendor and product IDs endianness for USB HID devices
12
13 The USB vendor and product IDs are not byteswapped appropriately, and
14 thus come out in the wrong endianness when fetched through the evdev
15 using ioctl() on big endian platforms.
16
17 Signed-off-by: Julien BLACHE <jb@jblache.org>
18 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20
21
22 ---
23 drivers/usb/input/hid-core.c | 4 ++--
24 1 file changed, 2 insertions(+), 2 deletions(-)
25
26 --- linux-2.6.20.1.orig/drivers/usb/input/hid-core.c
27 +++ linux-2.6.20.1/drivers/usb/input/hid-core.c
28 @@ -1212,8 +1212,8 @@ static struct hid_device *usb_hid_config
29 le16_to_cpu(dev->descriptor.idProduct));
30
31 hid->bus = BUS_USB;
32 - hid->vendor = dev->descriptor.idVendor;
33 - hid->product = dev->descriptor.idProduct;
34 + hid->vendor = le16_to_cpu(dev->descriptor.idVendor);
35 + hid->product = le16_to_cpu(dev->descriptor.idProduct);
36
37 usb_make_path(dev, hid->phys, sizeof(hid->phys));
38 strlcat(hid->phys, "/input", sizeof(hid->phys));