Skip to content

Commit 6ef5d5b

Browse files
khoroshilovbroonie
authored andcommitted
ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work()
There is a path in rt5645_jack_detect_work(), where rt5645->jd_mutex is left locked forever. That may lead to deadlock when rt5645_jack_detect_work() is called for the second time. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: cdba430 ("ASoC: rt5650: add mutex to avoid the jack detection failure") Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Link: https://lore.kernel.org/r/1707645514-21196-1-git-send-email-khoroshilov@ispras.ru Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 727b943 commit 6ef5d5b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

sound/soc/codecs/rt5645.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,6 +3317,7 @@ static void rt5645_jack_detect_work(struct work_struct *work)
33173317
report, SND_JACK_HEADPHONE);
33183318
snd_soc_jack_report(rt5645->mic_jack,
33193319
report, SND_JACK_MICROPHONE);
3320+
mutex_unlock(&rt5645->jd_mutex);
33203321
return;
33213322
case 4:
33223323
val = snd_soc_component_read(rt5645->component, RT5645_A_JD_CTRL1) & 0x0020;

0 commit comments

Comments
 (0)