ChangeSet 1.1722.97.81, 2004/06/17 15:23:14-07:00, [EMAIL PROTECTED]

[PATCH] USB: Fix endian bug in g_file_storage

This patch fixes a couple of places in g_file_storage where I forgot to
use proper byte-swapping.


Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/usb/gadget/file_storage.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
--- a/drivers/usb/gadget/file_storage.c Fri Jun 18 10:51:53 2004
+++ b/drivers/usb/gadget/file_storage.c Fri Jun 18 10:51:53 2004
@@ -2501,7 +2501,7 @@
                /* Store and send the Bulk-only CSW */
                csw->Signature = __constant_cpu_to_le32(USB_BULK_CS_SIG);
                csw->Tag = fsg->tag;
-               csw->Residue = fsg->residue;
+               csw->Residue = cpu_to_le32(fsg->residue);
                csw->Status = status;
 
                bh->inreq->length = USB_BULK_CS_WRAP_LEN;
@@ -2947,7 +2947,7 @@
                fsg->data_dir = DATA_DIR_TO_HOST;
        else
                fsg->data_dir = DATA_DIR_FROM_HOST;
-       fsg->data_size = cbw->DataTransferLength;
+       fsg->data_size = le32_to_cpu(cbw->DataTransferLength);
        if (fsg->data_size == 0)
                fsg->data_dir = DATA_DIR_NONE;
        fsg->lun = cbw->Lun;



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to