ASoC: soc-core: use device_unregister() if rtd allocation failed
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 30 Mar 2021 05:26:38 +0000 (14:26 +0900)
committerMark Brown <broonie@kernel.org>
Wed, 31 Mar 2021 17:02:23 +0000 (18:02 +0100)
commit5fa7553dcd83c576c589fd3e617dc599e4fe15dc
tree4e01d1028fe12407b39c3adf6b8fb9bdd73b8dc8
parentf1b3ee789f4b7a41ad93ff42d4efbae607622ae7
ASoC: soc-core: use device_unregister() if rtd allocation failed

Because soc_free_pcm_runtime(rtd) checks rtd pointer and freeing
rtd->xxx, it doesn't work correctly in case of rtd allocation failed.

We need to use device_unregister(dev) in such case.
This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1jxxldd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c