summaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/cdc-wdm.c
diff options
context:
space:
mode:
authorAl Viro2008-06-02 11:59:02 +0200
committerLinus Torvalds2008-06-04 17:06:01 +0200
commitfa4144b758d58341d4e082ac2af259e97fbcbeee (patch)
tree92e32411121076f717183c8ef7ba0ce2afe8ba3f /drivers/usb/class/cdc-wdm.c
parentusb/c67x00 endianness annotations (diff)
downloadkernel-qcow2-linux-fa4144b758d58341d4e082ac2af259e97fbcbeee.tar.gz
kernel-qcow2-linux-fa4144b758d58341d4e082ac2af259e97fbcbeee.tar.xz
kernel-qcow2-linux-fa4144b758d58341d4e082ac2af259e97fbcbeee.zip
cdc-wdm endianness fixes
* wMaxPacketSize is le16; copying it to a field of local structure and then using that field as host-endian (size of object to be allocated) is broken. * bMaxPacketSize0 is 8-bit; feeding it to le16_to_cpu() is bogus and since the result is used as host-endian, it's not even misspelled cpu_to_le16(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/class/cdc-wdm.c')
-rw-r--r--drivers/usb/class/cdc-wdm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 107666d4e2ec..731db051070a 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -611,8 +611,8 @@ next_desc:
goto err;
}
- desc->wMaxPacketSize = ep->wMaxPacketSize;
- desc->bMaxPacketSize0 = cpu_to_le16(udev->descriptor.bMaxPacketSize0);
+ desc->wMaxPacketSize = le16_to_cpu(ep->wMaxPacketSize);
+ desc->bMaxPacketSize0 = udev->descriptor.bMaxPacketSize0;
desc->orq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
if (!desc->orq)