ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 3 Oct 2023 15:55:57 +0000 (17:55 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 9 Oct 2023 12:03:36 +0000 (13:03 +0100)
commitf0dfdcbe706462495d47982eecd13a61aabd644d
treeea0ea5f54b6158e9ecadfefe0f8b669e62aa12ac
parent3ebebb2c1eca92a15107b2d7aeff34196fd9e217
ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind

Make sure to deregister the component when the driver is being unbound
and before the underlying device-managed resources are freed.

Fixes: 16572522aece ("ASoC: codecs: wcd938x-sdw: add SoundWire driver")
Cc: stable@vger.kernel.org # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20231003155558.27079-7-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd938x-sdw.c