]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: libertas: notify firmware load wait on disconnect
authorJakov Novak <jakovnovak30@gmail.com>
Mon, 4 May 2026 16:23:57 +0000 (18:23 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 5 May 2026 09:55:30 +0000 (11:55 +0200)
Currently, when the firmware is not fully loaded and if_usb_disconnect
is called, if_usb_prog_firmware gets stuck waiting for
cardp->surprise_removed or cardp->fwdnldover while lbs_remove_card
also waits for the firmware loading to be completed, which never happens.
This caused the reported syzbot bug. To address this, the wake_up
function call can be added in the if_usb_disconnect function which notifies
the if_usb_prog_firmware thread and resolves the firmware loading.

Fixes: 954ee164f4f4 ("[PATCH] libertas: reorganize and simplify init sequence")
Reported-and-tested-by: syzbot+c99d17aa44dbdba16ad2@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c99d17aa44dbdba16ad2
Signed-off-by: Jakov Novak <jakovnovak30@gmail.com>
Link: https://patch.msgid.link/20260504162356.17250-2-jakovnovak30@gmail.com
[fix subject]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/marvell/libertas/if_usb.c

index a00d53350fa97148bee9935f82664a00c99aff26..5cc0c5cac25745b29aae05543fe115a06b06b8c0 100644 (file)
@@ -310,6 +310,7 @@ static void if_usb_disconnect(struct usb_interface *intf)
        struct lbs_private *priv = cardp->priv;
 
        cardp->surprise_removed = 1;
+       wake_up(&cardp->fw_wq);
 
        if (priv) {
                lbs_stop_card(priv);