Unverified Commit 32ae6ebe authored by Johan Hovold's avatar Johan Hovold Committed by Mark Brown
Browse files

ASoC: codecs: wcd938x: 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: 8d78602a ("ASoC: codecs: wcd938x: add basic driver")
Cc: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Reviewed-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20251201093419.24474-3-johan@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 22a03ca7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3464,7 +3464,6 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
		return -ENODEV;
	}

	of_node_get(wcd938x->rxnode);
	component_match_add_release(dev, matchptr, component_release_of,
				    component_compare_of, wcd938x->rxnode);

@@ -3473,7 +3472,7 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
		dev_err(dev, "%s: Tx-device node not defined\n", __func__);
		return -ENODEV;
	}
	of_node_get(wcd938x->txnode);

	component_match_add_release(dev, matchptr, component_release_of,
				    component_compare_of, wcd938x->txnode);
	return 0;