Skip to content

Commit 22a03ca

Browse files
jhovoldbroonie
authored andcommitted
ASoC: codecs: wcd937x: 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: 9be3ec1 ("ASoC: codecs: wcd937x: add wcd937x codec driver") Cc: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com> Cc: Mohammad Rafi Shaik <mohammad.rafi.shaik@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-2-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c5fae31 commit 22a03ca

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/soc/codecs/wcd937x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,7 +2841,7 @@ static int wcd937x_add_slave_components(struct wcd937x_priv *wcd937x,
28412841
dev_err(dev, "Couldn't parse phandle to qcom,rx-device!\n");
28422842
return -ENODEV;
28432843
}
2844-
of_node_get(wcd937x->rxnode);
2844+
28452845
component_match_add_release(dev, matchptr, component_release_of,
28462846
component_compare_of, wcd937x->rxnode);
28472847

@@ -2850,7 +2850,7 @@ static int wcd937x_add_slave_components(struct wcd937x_priv *wcd937x,
28502850
dev_err(dev, "Couldn't parse phandle to qcom,tx-device\n");
28512851
return -ENODEV;
28522852
}
2853-
of_node_get(wcd937x->txnode);
2853+
28542854
component_match_add_release(dev, matchptr, component_release_of,
28552855
component_compare_of, wcd937x->txnode);
28562856

0 commit comments

Comments
 (0)