usb: storage: realtek_cr: Use correct byte order for bcs->Residue
Subsystems (3)
PATCH 1/1 usb: storage: realtek_cr: Use correct byte order for bcs->Residue
Since 'bcs->Residue' has the data type '__le32', convert it to the correct byte order of the CPU using this driver when assigning it to the local variable 'residue'.
Fixes 50a6cb932d5c ("USB: usb_storage: add ums-realtek driver")
Suggested-by Alan Stern <[email protected]>
Acked-by Alan Stern <[email protected]>
Signed-off-by Thorsten Blum <[email protected]>
---
Resending this as a separate patch for backporting as requested by Greg.
Link to previous patch: https://lore.kernel.org/lkml/[email protected]/
--- drivers/usb/storage/realtek_cr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/storage/realtek_cr.c +1 -1
@@ -253,7 +253,7 @@ static int rts51x_bulk_transport(struct us_data *us, u8 lun,return USB_STOR_TRANSPORT_ERROR ; } - residue = bcs->Residue; + residue =le32_to_cpu (bcs->Residue);if (bcs->Tag != us->tag)return USB_STOR_TRANSPORT_ERROR ;
Signature · 1 line
2.50.1