ASoC: codecs: wcd938x: fix resource leaks on bind errors
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 3 Oct 2023 15:55:54 +0000 (17:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 10:03:06 +0000 (12:03 +0200)
commitcc87f4db1417356289b7fe20eb7aea0369d33c38
tree27c4ec0212f4317671fd766019201a494add0081
parent8092aed6237564a2f0910da4fea49a361cfeaff3
ASoC: codecs: wcd938x: fix resource leaks on bind errors

commit da29b94ed3547cee9d510d02eca4009f2de476cf upstream.

Add the missing code to release resources on bind errors, including the
references taken by wcd938x_sdw_device_get() which also need to be
dropped on unbind().

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-4-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/codecs/wcd938x.c