USB: mos7720: fix big-endian control requests
authorJohan Hovold <jhovold@gmail.com>
Mon, 19 Aug 2013 11:05:45 +0000 (13:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Aug 2013 00:02:11 +0000 (17:02 -0700)
Fix endianess bugs in parallel-port code which caused corrupt
control-requests to be issued on big-endian machines.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/mos7720.c

index 248fda6d06f8d3df38b8e44c52594878fa380c90..84657e07dc5d6b914bd88da4697ab2f8c8b22de1 100644 (file)
@@ -382,8 +382,8 @@ static int write_parport_reg_nonblock(struct mos7715_parport *mos_parport,
        }
        urbtrack->setup->bRequestType = (__u8)0x40;
        urbtrack->setup->bRequest = (__u8)0x0e;
-       urbtrack->setup->wValue = get_reg_value(reg, dummy);
-       urbtrack->setup->wIndex = get_reg_index(reg);
+       urbtrack->setup->wValue = cpu_to_le16(get_reg_value(reg, dummy));
+       urbtrack->setup->wIndex = cpu_to_le16(get_reg_index(reg));
        urbtrack->setup->wLength = 0;
        usb_fill_control_urb(urbtrack->urb, usbdev,
                             usb_sndctrlpipe(usbdev, 0),