Skip to contentSkip to conversation

ALSA: hda/hdmi: Fix incorrect mutex unlock in silent_stream_disable()

PATCH In review Takashi Iwai 2 participants 2 messages Jan 1, 2021 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda/hdmi: Fix incorrect mutex unlock in silent_stream_disable()

The silent_stream_disable() function introduced by the commit b1a5039759cb ("ALSA: hda/hdmi: fix silent stream for first playback to DP") takes the per_pin->lock mutex, but it unlocks the wrong one, spec->pcm_lock, which causes a deadlock. This patch corrects it.

Fixes b1a5039759cb ("ALSA: hda/hdmi: fix silent stream for first playback to DP")
---
 sound/pci/hda/patch_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_hdmi.c +1 -1
index 1e4a4b83fbf6..74d246a0dc6d 100644
@@ -1733,7 +1733,7 @@ static void silent_stream_disable(struct hda_codec *codec,
 	per_pin->silent_stream = false;
 
  unlock_out:
-	mutex_unlock(&spec->pcm_lock);
+	mutex_unlock(&per_pin->lock);
 }
 
 /* update ELD and jack state via audio component */
Signature · 1 line
2.26.2
Acked-by on v1 1/1
#1 lore raw

Hi,

uh oh, I need to do some soul searching on how this slipped through. Seems to have been introduced in the V2 of the patch. Fix is correct, thanks Jan for reporting!

Quoted 4 lines · Takashi Iwai

The silent_stream_disable() function introduced by the commit b1a5039759cb ("ALSA: hda/hdmi: fix silent stream for first playback to DP") takes the per_pin->lock mutex, but it unlocks the wrong one, spec->pcm_lock, which causes a deadlock. This patch corrects it.

Br, Kai