]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:16:53 +0000 (10:16 +0100)
commit15424b48e226e4d9876d39433670c729338eef2b
tree315c1b4978a9968ad7ac81f59f89b108c1fa932a
parent21d87fde367a50464fa312e197c74f0e3387cae6
ASoC: codecs: wcd937x: Fix error handling in wcd937x codec driver

commit 578ccfe344c5f421c2c6343b872995b397ffd3ff upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/codecs/wcd937x.c