aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfangxiaozhi2013-02-07 01:32:07 -0600
committerGreg Kroah-Hartman2013-02-28 08:32:28 -0600
commitba18450b8528ed69d71b3cb8dbdecb08d9272c72 (patch)
tree6504fc3e6a54effa4f4c5abf294cfa36c9f2b81b
parente39d97f98e39ecb860d113ad75fa250bc52d247b (diff)
downloadkernel-common-ba18450b8528ed69d71b3cb8dbdecb08d9272c72.tar.gz
kernel-common-ba18450b8528ed69d71b3cb8dbdecb08d9272c72.tar.xz
kernel-common-ba18450b8528ed69d71b3cb8dbdecb08d9272c72.zip
USB: storage: properly handle the endian issues of idProduct
commit cd060956c5e97931c3909e4a808508469c0bb9f6 upstream. 1. The idProduct is little endian, so make sure its value to be compatible with the current CPU. Make no break on big endian processors. Signed-off-by: fangxiaozhi <huananhu@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/storage/initializers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/storage/initializers.c b/drivers/usb/storage/initializers.c
index 16b0bf055ee..7ab9046ae0e 100644
--- a/drivers/usb/storage/initializers.c
+++ b/drivers/usb/storage/initializers.c
@@ -147,7 +147,7 @@ static int usb_stor_huawei_dongles_pid(struct us_data *us)
147 int idProduct; 147 int idProduct;
148 148
149 idesc = &us->pusb_intf->cur_altsetting->desc; 149 idesc = &us->pusb_intf->cur_altsetting->desc;
150 idProduct = us->pusb_dev->descriptor.idProduct; 150 idProduct = le16_to_cpu(us->pusb_dev->descriptor.idProduct);
151 /* The first port is CDROM, 151 /* The first port is CDROM,
152 * means the dongle in the single port mode, 152 * means the dongle in the single port mode,
153 * and a switch command is required to be sent. */ 153 * and a switch command is required to be sent. */
@@ -169,7 +169,7 @@ int usb_stor_huawei_init(struct us_data *us)
169 int result = 0; 169 int result = 0;
170 170
171 if (usb_stor_huawei_dongles_pid(us)) { 171 if (usb_stor_huawei_dongles_pid(us)) {
172 if (us->pusb_dev->descriptor.idProduct >= 0x1446) 172 if (le16_to_cpu(us->pusb_dev->descriptor.idProduct) >= 0x1446)
173 result = usb_stor_huawei_scsi_init(us); 173 result = usb_stor_huawei_scsi_init(us);
174 else 174 else
175 result = usb_stor_huawei_feature_init(us); 175 result = usb_stor_huawei_feature_init(us);