ASoC: codecs: wcd939x: fix OF node leaks on probe failure

The component match entry release function will drop the references
taken while looking up the soundwire OF nodes when the platform device
is unbound.

Drop the additional references taken to avoid leaking them on probe
failure (e.g. probe deferral) and on driver unbind.

Fixes: 10f514bd17 ("ASoC: codecs: Add WCD939x Codec driver")
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20251201093419.24474-4-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
pull/1354/merge
Johan Hovold 2025-12-01 10:34:19 +01:00 committed by Mark Brown
parent 32ae6ebe17
commit 3ef4d9ede2
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 1 additions and 2 deletions

View File

@ -3526,7 +3526,6 @@ static int wcd939x_add_slave_components(struct wcd939x_priv *wcd939x,
return -ENODEV; return -ENODEV;
} }
of_node_get(wcd939x->rxnode);
component_match_add_release(dev, matchptr, component_release_of, component_match_add_release(dev, matchptr, component_release_of,
component_compare_of, wcd939x->rxnode); component_compare_of, wcd939x->rxnode);
@ -3535,7 +3534,7 @@ static int wcd939x_add_slave_components(struct wcd939x_priv *wcd939x,
dev_err(dev, "%s: Tx-device node not defined\n", __func__); dev_err(dev, "%s: Tx-device node not defined\n", __func__);
return -ENODEV; return -ENODEV;
} }
of_node_get(wcd939x->txnode);
component_match_add_release(dev, matchptr, component_release_of, component_match_add_release(dev, matchptr, component_release_of,
component_compare_of, wcd939x->txnode); component_compare_of, wcd939x->txnode);
return 0; return 0;