Commit 8f658815 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

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: 2889099e ('ASoC: hdac_hdmi: Register chmap controls and ops')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewd-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Tested-by: default avatarSachin Mokashi <sachinx.mokashi@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ea5a137d
...@@ -1614,7 +1614,7 @@ static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdac, int pcm_idx) ...@@ -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_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx);
struct hdac_hdmi_pin *pin = pcm->pin; struct hdac_hdmi_pin *pin = pcm->pin;
if (!pin && !pin->eld.eld_valid) if (!pin || !pin->eld.eld_valid)
return 0; return 0;
return pin->eld.info.spk_alloc; return pin->eld.info.spk_alloc;
......
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