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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 727b943 commit 6ef5d5b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)