[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260209060113.1731338-1-n7l8m4@u.northwestern.edu>
Date: Mon, 9 Feb 2026 06:01:13 +0000
From: Ziyi Guo <n7l8m4@...orthwestern.edu>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org,
Ziyi Guo <n7l8m4@...orthwestern.edu>
Subject: [PATCH] usb: image: mdc800: kill download URB on timeout
mdc800_device_read() submits download_urb and waits for completion.
If the timeout fires and the device has not responded, the function
returns without killing the URB, leaving it active.
A subsequent read() resubmits the same URB while it is still
in-flight, triggering the WARN in usb_submit_urb():
"URB submitted while active"
Add usb_kill_urb() on the download timeout error path, mirroring
how the write path in the same driver already handles its URB
timeout (line 863).
Similar to
- commit 372c93131998 ("USB: yurex: fix control-URB timeout handling")
- commit b98d5000c505 ("media: rc: iguanair: handle timeouts")
Signed-off-by: Ziyi Guo <n7l8m4@...orthwestern.edu>
---
drivers/usb/image/mdc800.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c
index 7b7e1554ea20..c4df637b2a03 100644
--- a/drivers/usb/image/mdc800.c
+++ b/drivers/usb/image/mdc800.c
@@ -736,6 +736,7 @@ static ssize_t mdc800_device_read (struct file *file, char __user *buf, size_t l
mdc800->downloaded = 0;
if (mdc800->download_urb->status != 0)
{
+ usb_kill_urb(mdc800->download_urb);
dev_err(&mdc800->dev->dev,
"request download-bytes fails "
"(status=%i)\n",
--
2.34.1
Powered by blists - more mailing lists