]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.20.2/usb-hid-fix-usb-vendor-and-product-ids-endianness-for-usb-hid-devices.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.20.2 / usb-hid-fix-usb-vendor-and-product-ids-endianness-for-usb-hid-devices.patch
CommitLineData
a1cd50fd
GKH
1From stable-bounces@linux.kernel.org Sun Feb 11 09:28:13 2007
2From: Julien BLACHE <jb@jblache.org>
3Date: Sun, 11 Feb 2007 18:27:09 +0100 (CET)
4Subject: USB HID: Fix USB vendor and product IDs endianness for USB HID devices
5To: stable@kernel.org
6Cc: Julien BLACHE <jb@jblache.org>
7Message-ID: <Pine.LNX.4.64.0702111825170.22290@jikos.suse.cz>
8
9From: Julien BLACHE <jb@jblache.org>
10
11[PATCH] USB HID: Fix USB vendor and product IDs endianness for USB HID devices
12
13The USB vendor and product IDs are not byteswapped appropriately, and
14thus come out in the wrong endianness when fetched through the evdev
15using ioctl() on big endian platforms.
16
17Signed-off-by: Julien BLACHE <jb@jblache.org>
18Signed-off-by: Jiri Kosina <jkosina@suse.cz>
19Signed-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));