summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXenia Ragiadakou <burzalodowa@gmail.com>2013-08-31 18:09:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 09:49:24 -0700
commit4d96799524159f7c3e774a7b45a308780a26dc4d (patch)
tree5fe14608b17644ff0296debcb41cfcd0096efe24
parent9df89d85b407690afa46ddfbccc80bec6869971d (diff)
usbcore: fix incorrect type in assignment in usb_set_lpm_parameters()
In the bos usb_ss_cap_descriptor structure, bU2DevExitLat is of type __le16. This value is used as it is, without being first converted to the CPU byteorder, for the setup of usb device's usb3_lpm_parameters. This patch fixes that by converting bU2DevExitLat field to the CPU byteorder before the assignmenment to [udev/hub]_u2_del variables. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/hub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 52a1de99c6f2..6f783bfe2959 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -315,9 +315,9 @@ static void usb_set_lpm_parameters(struct usb_device *udev)
return;
udev_u1_del = udev->bos->ss_cap->bU1devExitLat;
- udev_u2_del = udev->bos->ss_cap->bU2DevExitLat;
+ udev_u2_del = le16_to_cpu(udev->bos->ss_cap->bU2DevExitLat);
hub_u1_del = udev->parent->bos->ss_cap->bU1devExitLat;
- hub_u2_del = udev->parent->bos->ss_cap->bU2DevExitLat;
+ hub_u2_del = le16_to_cpu(udev->parent->bos->ss_cap->bU2DevExitLat);
usb_set_lpm_mel(udev, &udev->u1_params, udev_u1_del,
hub, &udev->parent->u1_params, hub_u1_del);