* [PATCH] usb: image: microtek: stop SG processing after transfer errors
@ 2026-07-23 19:56 Diego Fernando Mancera Gomez
2026-07-28 8:45 ` Oliver Neukum
0 siblings, 1 reply; 2+ messages in thread
From: Diego Fernando Mancera Gomez @ 2026-07-23 19:56 UTC (permalink / raw)
To: Oliver Neukum
Cc: Greg Kroah-Hartman, linux-usb, linux-kernel,
Diego Fernando Mancera Gomez
When an SG URB completes with an error, mts_do_sg() calls
mts_transfer_cleanup(), which completes the SCSI command through
scsi_done(). However, the callback continues advancing the scatterlist
and may submit another URB for a command that has already been
completed.
Return immediately after the cleanup so that no further processing is
performed on the completed command.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Diego Fernando Mancera Gomez <diegomancera.dev@gmail.com>
---
drivers/usb/image/microtek.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 1f0b3c44d388..787cf5aba55d 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -475,6 +475,7 @@ static void mts_do_sg (struct urb* transfer)
if (unlikely(status)) {
set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR));
mts_transfer_cleanup(transfer);
+ return;
}
context->curr_sg = sg_next(context->curr_sg);
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: image: microtek: stop SG processing after transfer errors
2026-07-23 19:56 [PATCH] usb: image: microtek: stop SG processing after transfer errors Diego Fernando Mancera Gomez
@ 2026-07-28 8:45 ` Oliver Neukum
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Neukum @ 2026-07-28 8:45 UTC (permalink / raw)
To: Diego Fernando Mancera Gomez, Oliver Neukum
Cc: Greg Kroah-Hartman, linux-usb, linux-kernel
On 23.07.26 21:56, Diego Fernando Mancera Gomez wrote:
> When an SG URB completes with an error, mts_do_sg() calls
> mts_transfer_cleanup(), which completes the SCSI command through
> scsi_done(). However, the callback continues advancing the scatterlist
> and may submit another URB for a command that has already been
> completed.
>
> Return immediately after the cleanup so that no further processing is
> performed on the completed command.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Diego Fernando Mancera Gomez <diegomancera.dev@gmail.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-28 8:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-23 19:56 [PATCH] usb: image: microtek: stop SG processing after transfer errors Diego Fernando Mancera Gomez
2026-07-28 8:45 ` Oliver Neukum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome