mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 19:53:59 +08:00
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: 2889099eb8
('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>
This commit is contained in:
parent
ea5a137d0f
commit
8f658815da
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user