Skip to content

Commit 8f65881

Browse files
Dan Carpenterbroonie
authored andcommitted
ASoC: hdac_hdmi: Potential NULL deref in hdac_hdmi_get_spk_alloc()
We intended || here instead of &&. The original code potentially leads to a NULL dereference. Fixes: 2889099 ('ASoC: hdac_hdmi: Register chmap controls and ops') Signed-off-by: Dan Carpenter <[email protected]> Reviewd-by: Takashi Sakamoto <[email protected]> Acked-by: Vinod Koul <[email protected]> Tested-by: Sachin Mokashi <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent ea5a137 commit 8f65881

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/codecs/hdac_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdac, int pcm_idx)
16141614
struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx);
16151615
struct hdac_hdmi_pin *pin = pcm->pin;
16161616

1617-
if (!pin && !pin->eld.eld_valid)
1617+
if (!pin || !pin->eld.eld_valid)
16181618
return 0;
16191619

16201620
return pin->eld.info.spk_alloc;

0 commit comments

Comments
 (0)