Skip to content

Commit 378da36

Browse files
tobluxgregkh
authored andcommitted
usb: storage: realtek_cr: Use correct byte order for bcs->Residue
commit 98da66a upstream. 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'. Cc: stable <stable@kernel.org> Fixes: 50a6cb9 ("USB: usb_storage: add ums-realtek driver") Suggested-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://lore.kernel.org/r/20250813145247.184717-3-thorsten.blum@linux.dev Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8ea397f commit 378da36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/storage/realtek_cr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static int rts51x_bulk_transport(struct us_data *us, u8 lun,
252252
return USB_STOR_TRANSPORT_ERROR;
253253
}
254254

255-
residue = bcs->Residue;
255+
residue = le32_to_cpu(bcs->Residue);
256256
if (bcs->Tag != us->tag)
257257
return USB_STOR_TRANSPORT_ERROR;
258258

0 commit comments

Comments
 (0)