Skip to content

Commit

Permalink
ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
khoroshilov authored and broonie committed Feb 11, 2024
1 parent 727b943 commit 6ef5d5b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/soc/codecs/rt5645.c
Original file line number Diff line number Diff line change
Expand Up @@ -3317,6 +3317,7 @@ static void rt5645_jack_detect_work(struct work_struct *work)
report, SND_JACK_HEADPHONE);
snd_soc_jack_report(rt5645->mic_jack,
report, SND_JACK_MICROPHONE);
mutex_unlock(&rt5645->jd_mutex);
return;
case 4:
val = snd_soc_component_read(rt5645->component, RT5645_A_JD_CTRL1) & 0x0020;
Expand Down

0 comments on commit 6ef5d5b

Please sign in to comment.