aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/devio.c
diff options
context:
space:
mode:
authorXenia Ragiadakou <burzalodowa@gmail.com>2013-08-31 11:09:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 12:49:24 -0400
commitc8f2efc8f636506e0f0c2ba4035382076875f0c1 (patch)
treedfb390f7a2da63976ce2dbfcafc3007ca6e0c41c /drivers/usb/core/devio.c
parent4d96799524159f7c3e774a7b45a308780a26dc4d (diff)
usbcore: fix read of usbdevfs_ctrltransfer fields in proc_control()
Urb fields are stored in struct usbdevfs_ctrltransfer in CPU byteorder and not in little endian, so there is no need to be converted. This bug was reported by sparse. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r--drivers/usb/core/devio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 737e3c19967b..f4f2300f8e10 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -898,10 +898,8 @@ static int proc_control(struct dev_state *ps, void __user *arg)
898 snoop(&dev->dev, "control urb: bRequestType=%02x " 898 snoop(&dev->dev, "control urb: bRequestType=%02x "
899 "bRequest=%02x wValue=%04x " 899 "bRequest=%02x wValue=%04x "
900 "wIndex=%04x wLength=%04x\n", 900 "wIndex=%04x wLength=%04x\n",
901 ctrl.bRequestType, ctrl.bRequest, 901 ctrl.bRequestType, ctrl.bRequest, ctrl.wValue,
902 __le16_to_cpup(&ctrl.wValue), 902 ctrl.wIndex, ctrl.wLength);
903 __le16_to_cpup(&ctrl.wIndex),
904 __le16_to_cpup(&ctrl.wLength));
905 if (ctrl.bRequestType & 0x80) { 903 if (ctrl.bRequestType & 0x80) {
906 if (ctrl.wLength && !access_ok(VERIFY_WRITE, ctrl.data, 904 if (ctrl.wLength && !access_ok(VERIFY_WRITE, ctrl.data,
907 ctrl.wLength)) { 905 ctrl.wLength)) {