The driver waits for each bulk transfer with wait_event_interruptible_timeout() so that a signal can abort the wait. Only the timeout path kills the URB; when the wait returns -ERESTARTSYS the function returns with the URB still submitted. The URB then stays in flight on the endpoint and the next transfer on the same endpoint calls usb_submit_urb() on it again. The USB core rejects this with the "URB submitted while active" warning and -EBUSY, so every later register or memory access fails and the driver gives up on the device. The late completion can also clear the shared busy flag and wake a subsequent transfer, which then reads a stale buffer. Kill the URB on the interrupted path as well, so that a transfer is never left active once these helpers return. Fixes: b1906cea00b0 ("wifi: mm81x: add mm81x Wi-Fi HaLow driver") Cc: stable@vger.kernel.org Co-developed-by: Bin Yu Signed-off-by: Bin Yu Co-developed-by: Cheng Wen Signed-off-by: Cheng Wen Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> --- drivers/net/wireless/morsemicro/mm81x/usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/morsemicro/mm81x/usb.c b/drivers/net/wireless/morsemicro/mm81x/usb.c index ec94936b157b..3b3ffd94e4d6 100644 --- a/drivers/net/wireless/morsemicro/mm81x/usb.c +++ b/drivers/net/wireless/morsemicro/mm81x/usb.c @@ -257,6 +257,7 @@ static int mm81x_usb_cmd(struct mm81x_usb *musb, msecs_to_jiffies(URB_TIMEOUT_MS)); if (retval < 0) { dev_err(mors->dev, "error waiting for urb %d", retval); + usb_kill_urb(ep->urb); goto error; } else if (retval == 0) { dev_err(mors->dev, "timed out waiting for urb"); @@ -366,6 +367,7 @@ static int mm81x_usb_mem_read(struct mm81x_usb *musb, u32 address, u8 *data, msecs_to_jiffies(URB_TIMEOUT_MS)); if (ret < 0) { dev_err(mors->dev, "wait_event_interruptible: error %d", ret); + usb_kill_urb(musb->endpoints[MM81X_EP_MEM_RD].urb); goto error; } else if (ret == 0) { /* Timed out. */ @@ -436,6 +438,7 @@ static int mm81x_usb_mem_write(struct mm81x_usb *musb, u32 address, u8 *data, msecs_to_jiffies(URB_TIMEOUT_MS)); if (ret < 0) { dev_err(mors->dev, "error %d", ret); + usb_kill_urb(musb->endpoints[MM81X_EP_MEM_WR].urb); goto error; } else if (ret == 0) { /* Timed out. */ -- 2.34.1