Skip to content

Commit 32ae6eb

Browse files
jhovoldbroonie
authored andcommitted
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: 8d78602 ("ASoC: codecs: wcd938x: add basic driver") Cc: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20251201093419.24474-3-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 22a03ca commit 32ae6eb

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

sound/soc/codecs/wcd938x.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3464,7 +3464,6 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
34643464
return -ENODEV;
34653465
}
34663466

3467-
of_node_get(wcd938x->rxnode);
34683467
component_match_add_release(dev, matchptr, component_release_of,
34693468
component_compare_of, wcd938x->rxnode);
34703469

@@ -3473,7 +3472,7 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
34733472
dev_err(dev, "%s: Tx-device node not defined\n", __func__);
34743473
return -ENODEV;
34753474
}
3476-
of_node_get(wcd938x->txnode);
3475+
34773476
component_match_add_release(dev, matchptr, component_release_of,
34783477
component_compare_of, wcd938x->txnode);
34793478
return 0;

0 commit comments

Comments
 (0)