sound: usb: Add NULL check against udev with uaudio_dev_cleanup() API
uaudio_dev_cleanup() API can be called from ADSP SSR context (from work
context) and USB headset disconnect context. When USB headset is being
removed, driver sends disconnect notification to ADSP firmware and it can
be blocked for 10 seconds (timeout) before calling uaudio_dev_cleanup().
If this thread is block (possibly due to ADSP SSR), and in parallel driver
is handling ADSP SSR notification, driver is releasing all resource
including secondary event ring. Once above thread unblocks or timeout, it
goes try to release secondary USB event ring. As uaudio_dev_cleanup() is
already being called, and release secondary USB event ring, it shall see
udev->dev as NULL. Fix this issue by adding explicit check against udev
with uaudio_dev_cleanup() API.
Change-Id: I1e2e4a61dcbea4c0570ac97677bf74b453fac82c
Signed-off-by:  Mayank Rana <mrana@codeaurora.org>
Mayank Rana <mrana@codeaurora.org>
Loading
Please register or sign in to comment
