Skip to content

Commit 00c0317

Browse files
hrasiqgregkh
authored andcommitted
wifi: libertas: don't kill URBs in interrupt context
[ Upstream commit 7c5c2b6 ] Serialization for the TX path was enforced by calling usb_kill_urb()/usb_kill_anchored_urbs(), to prevent transmission before a previous URB was completed. usb_tx_block() can be called from interrupt context (e.g. in the HCD giveback path), so we can't always use it to kill in-flight URBs. Prevent sleeping during interrupt context by checking the tx_submitted anchor for existing URBs. We now return -EBUSY, to indicate there's a pending request. Reported-by: syzbot+74afbb6355826ffc2239@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=74afbb6355826ffc2239 Fixes: d66676e ("wifi: libertas: fix WARNING in usb_tx_block") Signed-off-by: Heitor Alves de Siqueira <halves@igalia.com> Link: https://patch.msgid.link/20260313-libertas-usb-anchors-v1-2-915afbe988d7@igalia.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a761a15 commit 00c0317

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • drivers/net/wireless/marvell/libertas

drivers/net/wireless/marvell/libertas/if_usb.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,12 @@ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb
429429
goto tx_ret;
430430
}
431431

432-
usb_kill_anchored_urbs(&cardp->tx_submitted);
432+
/* check if there are pending URBs */
433+
if (!usb_anchor_empty(&cardp->tx_submitted)) {
434+
lbs_deb_usbd(&cardp->udev->dev, "%s failed: pending URB\n", __func__);
435+
ret = -EBUSY;
436+
goto tx_ret;
437+
}
433438

434439
usb_fill_bulk_urb(cardp->tx_urb, cardp->udev,
435440
usb_sndbulkpipe(cardp->udev,

0 commit comments

Comments
 (0)