]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: ice1712: Do not left ice->gpio_mutex locked in aureon_add_controls()
authorDmitry Fomin <fomindmitriyfoma@mail.ru>
Sat, 25 Feb 2023 18:43:21 +0000 (21:43 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:03 +0000 (16:44 +0100)
commita6198534c4ec800e67da4746c2deb2e095759c69
tree1733cb3244782cbac0b8087c7e7beb7a5ca43365
parent88c2bf99c04d21cfa2f86763fcf815aeb8bf1b41
ALSA: ice1712: Do not left ice->gpio_mutex locked in aureon_add_controls()

commit 951606a14a8901e3551fe4d8d3cedd73fe954ce1 upstream.

If snd_ctl_add() fails in aureon_add_controls(), it immediately returns
and leaves ice->gpio_mutex locked. ice->gpio_mutex locks in
snd_ice1712_save_gpio_status and unlocks in
snd_ice1712_restore_gpio_status(ice).

It seems that the mutex is required only for aureon_cs8415_get(),
so snd_ice1712_restore_gpio_status(ice) can be placed
just after that. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Dmitry Fomin <fomindmitriyfoma@mail.ru>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230225184322.6286-1-fomindmitriyfoma@mail.ru
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/ice1712/aureon.c