Skip to content

Commit

Permalink
ASoC: hdac_hdmi: Potential NULL deref in hdac_hdmi_get_spk_alloc()
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Sachin Mokashi <sachinx.mokashi@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Dan Carpenter authored and Mark Brown committed May 3, 2016
1 parent ea5a137 commit 8f65881
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/codecs/hdac_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8f65881

Please sign in to comment.