Skip to content
Unverified Commit 8e3366ca authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown
Browse files

ASoC: Fix NULL dereference at freeing



When an ASoC driver with pcm_destruct component ops is freed before
the PCM object instantiation (e.g. deferring the probe), it hits an
Oops at snd_soc_pcm_component_free() that calls the pcm_destruct ops
unconditionally.

Fix it by adding a NULL-check of rtd->pcm before calling callbacks.

Fixes: c64bfc90 ("ASoC: soc-core: add new pcm_construct/pcm_destruct")
Reported-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
Tested-by: default avatarBen Ho <ben.ho@mediatek.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200107070956.15807-1-tiwai@suse.de


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 869bced7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment