aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2016-05-03 10:42:58 +0300
committerMark Brown <[email protected]>2016-05-03 17:30:13 +0100
commit8f658815da156a9239b98b34e5ba1d3db71a2f6e (patch)
tree2cab3ee1f64e8726397c3b286df2431443f87cea
parentea5a137d0fe263854ae6267a0fa208c544d83452 (diff)
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 <[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]>
-rw-r--r--sound/soc/codecs/hdac_hdmi.c2
1 files changed, 1 insertions, 1 deletions
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;