Commit a2f64724 authored by Wu Bo's avatar Wu Bo Committed by Takashi Iwai

ALSA: hda/hdmi: fix without unlocked before return

Fix the following coccicheck warning:
sound/pci/hda/patch_hdmi.c:1852:2-8: preceding lock on line 1846

After add sanity check to pass klockwork check,
The spdif_mutex should be unlock before return true
in check_non_pcm_per_cvt().

Fixes: 960a581e ("ALSA: hda: fix some klockwork scan warnings")
Signed-off-by: default avatarWu Bo <wubo40@huawei.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1587907042-694161-1-git-send-email-wubo40@huawei.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ca76282b
...@@ -1848,8 +1848,10 @@ static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid) ...@@ -1848,8 +1848,10 @@ static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid)
/* Add sanity check to pass klockwork check. /* Add sanity check to pass klockwork check.
* This should never happen. * This should never happen.
*/ */
if (WARN_ON(spdif == NULL)) if (WARN_ON(spdif == NULL)) {
mutex_unlock(&codec->spdif_mutex);
return true; return true;
}
non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO); non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO);
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return non_pcm; return non_pcm;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment