提交 9fa2ad5f 编写于 作者: J Julien BLACHE 提交者: Jiri Kosina

USB HID: Fix USB vendor and product IDs endianness for USB HID devices

The USB vendor and product IDs are not byteswapped appropriately, and
thus come out in the wrong endianness when fetched through the evdev
using ioctl() on big endian platforms.
Signed-off-by: NJulien BLACHE <jb@jblache.org>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 606135a3
......@@ -1225,8 +1225,8 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
le16_to_cpu(dev->descriptor.idProduct));
hid->bus = BUS_USB;
hid->vendor = dev->descriptor.idVendor;
hid->product = dev->descriptor.idProduct;
hid->vendor = le16_to_cpu(dev->descriptor.idVendor);
hid->product = le16_to_cpu(dev->descriptor.idProduct);
usb_make_path(dev, hid->phys, sizeof(hid->phys));
strlcat(hid->phys, "/input", sizeof(hid->phys));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册