Skip to content

Commit a2f6472

Browse files
Wu Botiwai
authored andcommitted
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: 960a581 ("ALSA: hda: fix some klockwork scan warnings") Signed-off-by: Wu Bo <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent ca76282 commit a2f6472

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,8 +1848,10 @@ static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid)
18481848
/* Add sanity check to pass klockwork check.
18491849
* This should never happen.
18501850
*/
1851-
if (WARN_ON(spdif == NULL))
1851+
if (WARN_ON(spdif == NULL)) {
1852+
mutex_unlock(&codec->spdif_mutex);
18521853
return true;
1854+
}
18531855
non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO);
18541856
mutex_unlock(&codec->spdif_mutex);
18551857
return non_pcm;

0 commit comments

Comments
 (0)