Skip to content

Commit 360b373

Browse files
ISCAS-Vulabbroonie
authored andcommitted
ASoC: rsnd: fix OF node reference leak in rsnd_ssiu_probe()
rsnd_ssiu_probe() leaks an OF node reference obtained by rsnd_ssiu_of_node(). The node reference is acquired but never released across all return paths. Fix it by declaring the device node with the __free(device_node) cleanup construct to ensure automatic release when the variable goes out of scope. Fixes: 4e7788f ("ASoC: rsnd: add SSIU BUSIF support") Signed-off-by: Haotian Zhang <[email protected]> Acked-by: Kuninori Morimoto <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent eb2d677 commit 360b373

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sound/soc/renesas/rcar/ssiu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ void rsnd_parse_connect_ssiu(struct rsnd_dai *rdai,
509509
int rsnd_ssiu_probe(struct rsnd_priv *priv)
510510
{
511511
struct device *dev = rsnd_priv_to_dev(priv);
512-
struct device_node *node;
512+
struct device_node *node __free(device_node) = rsnd_ssiu_of_node(priv);
513513
struct rsnd_ssiu *ssiu;
514514
struct rsnd_mod_ops *ops;
515515
const int *list = NULL;
@@ -522,7 +522,6 @@ int rsnd_ssiu_probe(struct rsnd_priv *priv)
522522
* see
523523
* rsnd_ssiu_bufsif_to_id()
524524
*/
525-
node = rsnd_ssiu_of_node(priv);
526525
if (node)
527526
nr = rsnd_node_count(priv, node, SSIU_NAME);
528527
else

0 commit comments

Comments
 (0)