Commit 88c66084 authored by Zebediah Figura's avatar Zebediah Figura Committed by Mauro Carvalho Chehab

media: cx231xx: Use snd_card_free_when_closed() instead of snd_card_free().

cx231xx_close_extension and hence cx231xx_audio_fini() are called with the
cx231xx device lock held, but snd_cx231xx_pcm_close() also grabs that mutex
when closing the file on behalf of arecord. There seems to be no reason to
wait for sound card resources to be released, so let the release be
asynchronous.

Tested with a Hauppauge 955Q (2040:b123) and Linux 5.9.6; the hang
described in the bug no longer occurs and disconnecting the device
correctly terminates arecord with ENODEV.

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=204087Signed-off-by: default avatarZebediah Figura <zfigura@codeweavers.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent cf7f3477
......@@ -670,7 +670,7 @@ static int cx231xx_audio_fini(struct cx231xx *dev)
}
if (dev->adev.sndcard) {
snd_card_free(dev->adev.sndcard);
snd_card_free_when_closed(dev->adev.sndcard);
kfree(dev->adev.alt_max_pkt_size);
dev->adev.sndcard = NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment