]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Fix NULL dereference at freeing
authorTakashi Iwai <tiwai@suse.de>
Tue, 7 Jan 2020 07:09:56 +0000 (08:09 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 7 Jan 2020 22:27:44 +0000 (22:27 +0000)
commit1802c92ac5825e81db1058828d0f322b819002a8
treeefc5b85d712fd313266e450691b1cf587ffa5606
parent04f40c3b5a20ebc235be11f893deb88f2cac8ec7
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: 5246cc719ba2 ("ASoC: soc-core: add new pcm_construct/pcm_destruct")
Reported-by: Matthias Brugger <matthias.bgg@gmail.com>
Tested-by: Ben Ho <ben.ho@mediatek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200107070956.15807-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-component.c