Skip to content

Commit 951606a

Browse files
fiflfomkatiwai
authored andcommitted
ALSA: ice1712: Do not left ice->gpio_mutex locked in aureon_add_controls()
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: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Dmitry Fomin <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent ea24b99 commit 951606a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/pci/ice1712/aureon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,7 @@ static int aureon_add_controls(struct snd_ice1712 *ice)
18921892
unsigned char id;
18931893
snd_ice1712_save_gpio_status(ice);
18941894
id = aureon_cs8415_get(ice, CS8415_ID);
1895+
snd_ice1712_restore_gpio_status(ice);
18951896
if (id != 0x41)
18961897
dev_info(ice->card->dev,
18971898
"No CS8415 chip. Skipping CS8415 controls.\n");
@@ -1909,7 +1910,6 @@ static int aureon_add_controls(struct snd_ice1712 *ice)
19091910
kctl->id.device = ice->pcm->device;
19101911
}
19111912
}
1912-
snd_ice1712_restore_gpio_status(ice);
19131913
}
19141914

19151915
return 0;

0 commit comments

Comments
 (0)