From 8f658815da156a9239b98b34e5ba1d3db71a2f6e Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 3 May 2016 10:42:58 +0300 Subject: [PATCH] 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: 2889099eb8cd ('ASoC: hdac_hdmi: Register chmap controls and ops') Signed-off-by: Dan Carpenter Reviewd-by: Takashi Sakamoto Acked-by: Vinod Koul Tested-by: Sachin Mokashi Signed-off-by: Mark Brown --- sound/soc/codecs/hdac_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 0ed39753c871..f1170e060230 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1614,7 +1614,7 @@ static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdac, int pcm_idx) struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx); struct hdac_hdmi_pin *pin = pcm->pin; - if (!pin && !pin->eld.eld_valid) + if (!pin || !pin->eld.eld_valid) return 0; return pin->eld.info.spk_alloc; -- 2.20.1