Skip to content
Snippets Groups Projects
Commit dafb28f0 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: usx2y: Use snd_card_free_when_closed() at disconnection


The USB disconnect callback is supposed to be short and not too-long
waiting.  OTOH, the current code uses snd_card_free() at
disconnection, but this waits for the close of all used fds, hence it
can take long.  It eventually blocks the upper layer USB ioctls, which
may trigger a soft lockup.

An easy workaround is to replace snd_card_free() with
snd_card_free_when_closed().  This variant returns immediately while
the release of resources is done asynchronously by the card device
release at the last close.

Fixes: 230cd5e2 ("[ALSA] prevent oops & dead keyboard on usb unplugging while the device is be ing used")
Reported-by: default avatar <syzbot+73582d08864d8268b6fd@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=73582d08864d8268b6fd


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20241113111042.15058-2-tiwai@suse.de
parent f69c2861
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment