ChangeSet 1.1722.97.81, 2004/06/17 15:23:14-07:00, stern@rowland.harvard.edu [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 Signed-off-by: Greg Kroah-Hartman 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;