diff mbox series

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

Message ID 20210101083852.12094-1-tiwai@suse.de (mailing list archive)
State Accepted
Commit 3d5c5fdcee0f9a94deb0472e594706018b00aa31
Headers show
Series ALSA: hda/hdmi: Fix incorrect mutex unlock in silent_stream_disable() | expand

Commit Message

Takashi Iwai Jan. 1, 2021, 8:38 a.m. UTC
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")
Reported-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/patch_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kai Vehmanen Jan. 1, 2021, 5:47 p.m. UTC | #1
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!

On Fri, 1 Jan 2021, Takashi Iwai wrote:

> 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.

Acked-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>

Br, Kai
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 1e4a4b83fbf6..74d246a0dc6d 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -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 */