Commit 311a4137 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[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: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 9f7eda28
......@@ -2501,7 +2501,7 @@ static int send_status(struct fsg_dev *fsg)
/* 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 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment