* [PATCH 3/3] usb: storage: realtek_cr: Use correct byte order for bcs->Residue
[not found] <20250813101249.158270-2-thorsten.blum@linux.dev>
@ 2025-08-13 10:12 ` Thorsten Blum
2025-08-13 14:00 ` Alan Stern
2025-08-13 14:39 ` Greg Kroah-Hartman
0 siblings, 2 replies; 4+ messages in thread
From: Thorsten Blum @ 2025-08-13 10:12 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman, wwang
Cc: Thorsten Blum, stable, Greg Kroah-Hartman, linux-usb, usb-storage,
linux-kernel
Since 'bcs->Residue' has the data type '__le32', we must convert it to
the correct byte order of the CPU using this driver when assigning it to
the local variable 'residue'.
Cc: stable@vger.kernel.org
Fixes: 50a6cb932d5c ("USB: usb_storage: add ums-realtek driver")
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/usb/storage/realtek_cr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
index 8a4d7c0f2662..758258a569a6 100644
--- a/drivers/usb/storage/realtek_cr.c
+++ b/drivers/usb/storage/realtek_cr.c
@@ -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;
--
2.50.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] usb: storage: realtek_cr: Use correct byte order for bcs->Residue
2025-08-13 10:12 ` [PATCH 3/3] usb: storage: realtek_cr: Use correct byte order for bcs->Residue Thorsten Blum
@ 2025-08-13 14:00 ` Alan Stern
2025-08-13 14:39 ` Greg Kroah-Hartman
1 sibling, 0 replies; 4+ messages in thread
From: Alan Stern @ 2025-08-13 14:00 UTC (permalink / raw)
To: Thorsten Blum
Cc: Greg Kroah-Hartman, wwang, stable, Greg Kroah-Hartman, linux-usb,
usb-storage, linux-kernel
On Wed, Aug 13, 2025 at 12:12:51PM +0200, Thorsten Blum wrote:
> Since 'bcs->Residue' has the data type '__le32', we must convert it to
> the correct byte order of the CPU using this driver when assigning it to
> the local variable 'residue'.
>
> Cc: stable@vger.kernel.org
> Fixes: 50a6cb932d5c ("USB: usb_storage: add ums-realtek driver")
> Suggested-by: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/usb/storage/realtek_cr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
> index 8a4d7c0f2662..758258a569a6 100644
> --- a/drivers/usb/storage/realtek_cr.c
> +++ b/drivers/usb/storage/realtek_cr.c
> @@ -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;
>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] usb: storage: realtek_cr: Use correct byte order for bcs->Residue
2025-08-13 10:12 ` [PATCH 3/3] usb: storage: realtek_cr: Use correct byte order for bcs->Residue Thorsten Blum
2025-08-13 14:00 ` Alan Stern
@ 2025-08-13 14:39 ` Greg Kroah-Hartman
2025-08-13 14:57 ` Thorsten Blum
1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2025-08-13 14:39 UTC (permalink / raw)
To: Thorsten Blum
Cc: Alan Stern, wwang, stable, Greg Kroah-Hartman, linux-usb,
usb-storage, linux-kernel
On Wed, Aug 13, 2025 at 12:12:51PM +0200, Thorsten Blum wrote:
> Since 'bcs->Residue' has the data type '__le32', we must convert it to
> the correct byte order of the CPU using this driver when assigning it to
> the local variable 'residue'.
>
> Cc: stable@vger.kernel.org
When you have a bugfix, don't put it last in the patch series, as that
doesn't make much sense if you want to backport it anywhere, like you
are asking to do here.
Please just send this as a separate patch, and do the cleanups in a
different series.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] usb: storage: realtek_cr: Use correct byte order for bcs->Residue
2025-08-13 14:39 ` Greg Kroah-Hartman
@ 2025-08-13 14:57 ` Thorsten Blum
0 siblings, 0 replies; 4+ messages in thread
From: Thorsten Blum @ 2025-08-13 14:57 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Alan Stern, wwang, stable, Greg Kroah-Hartman, linux-usb,
usb-storage, linux-kernel
On 13. Aug 2025, at 16:39, Greg Kroah-Hartman wrote:
> On Wed, Aug 13, 2025 at 12:12:51PM +0200, Thorsten Blum wrote:
>> Since 'bcs->Residue' has the data type '__le32', we must convert it to
>> the correct byte order of the CPU using this driver when assigning it to
>> the local variable 'residue'.
>>
>> Cc: stable@vger.kernel.org
>
> When you have a bugfix, don't put it last in the patch series, as that
> doesn't make much sense if you want to backport it anywhere, like you
> are asking to do here.
>
> Please just send this as a separate patch, and do the cleanups in a
> different series.
Ok, you can find it here:
https://lore.kernel.org/lkml/20250813145247.184717-3-thorsten.blum@linux.dev/
Thanks,
Thorsten
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-13 14:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250813101249.158270-2-thorsten.blum@linux.dev>
2025-08-13 10:12 ` [PATCH 3/3] usb: storage: realtek_cr: Use correct byte order for bcs->Residue Thorsten Blum
2025-08-13 14:00 ` Alan Stern
2025-08-13 14:39 ` Greg Kroah-Hartman
2025-08-13 14:57 ` Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox