This is a note to let you know that I've just added the patch titled

    USB: storage: properly handle the endian issues of idProduct

to the 3.8-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-storage-properly-handle-the-endian-issues-of-idproduct.patch
and it can be found in the queue-3.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From cd060956c5e97931c3909e4a808508469c0bb9f6 Mon Sep 17 00:00:00 2001
From: fangxiaozhi <[email protected]>
Date: Thu, 7 Feb 2013 15:32:07 +0800
Subject: USB: storage: properly handle the endian issues of idProduct

From: fangxiaozhi <[email protected]>

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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/usb/storage/initializers.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/usb/storage/initializers.c
+++ b/drivers/usb/storage/initializers.c
@@ -147,7 +147,7 @@ static int usb_stor_huawei_dongles_pid(s
        int idProduct;
 
        idesc = &us->pusb_intf->cur_altsetting->desc;
-       idProduct = us->pusb_dev->descriptor.idProduct;
+       idProduct = le16_to_cpu(us->pusb_dev->descriptor.idProduct);
        /* The first port is CDROM,
         * means the dongle in the single port mode,
         * and a switch command is required to be sent. */
@@ -169,7 +169,7 @@ int usb_stor_huawei_init(struct us_data
        int result = 0;
 
        if (usb_stor_huawei_dongles_pid(us)) {
-               if (us->pusb_dev->descriptor.idProduct >= 0x1446)
+               if (le16_to_cpu(us->pusb_dev->descriptor.idProduct) >= 0x1446)
                        result = usb_stor_huawei_scsi_init(us);
                else
                        result = usb_stor_huawei_feature_init(us);


Patches currently in stable-queue which might be from [email protected] are

queue-3.8/usb-storage-properly-handle-the-endian-issues-of-idproduct.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to