Skip to content

Commit

Permalink
USB HID: Fix USB vendor and product IDs endianness for USB HID devices
Browse files Browse the repository at this point in the history
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: Julien BLACHE <jb@jblache.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Julien BLACHE authored and Jiri Kosina committed Mar 1, 2007
1 parent 606135a commit 9fa2ad5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/input/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9fa2ad5

Please sign in to comment.