]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: codecs: wcd937x: Fix error handling in wcd937x codec driver
authorMa Ke <make24@iscas.ac.cn>
Sun, 16 Nov 2025 06:16:23 +0000 (14:16 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 17 Nov 2025 00:45:05 +0000 (00:45 +0000)
commit578ccfe344c5f421c2c6343b872995b397ffd3ff
treeaafc04127e7eea630a55c3a2847296d79e8ec474
parent6a23ae0a96a600d1d12557add110e0bb6e32730c
ASoC: codecs: wcd937x: Fix error handling in wcd937x codec driver

In wcd937x_bind(), the driver calls of_sdw_find_device_by_node() to
obtain references to RX and TX SoundWire devices, which increment the
device reference counts. However, the corresponding put_device() are
missing in both the error paths and the normal unbind path in
wcd937x_unbind().

Add proper error handling with put_device() calls in all error paths
of wcd937x_bind() and ensure devices are released in wcd937x_unbind().

Found by code review.

Cc: stable@vger.kernel.org
Fixes: 772ed12bd04e ("ASoC: codecs: wcdxxxx: use of_sdw_find_device_by_node helper")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Reviewed-by: David Heidelberg <david@ixit.cz>
Link: https://patch.msgid.link/20251116061623.11830-1-make24@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd937x.c