Skip to content

Commit 5a24389

Browse files
Yang Yingliangkuba-moo
authored andcommitted
net: dsa: rzn1-a5psw: add missing of_node_put() in a5psw_pcs_get()
of_parse_phandle() will increase the refcount of 'pcs_node', so add of_node_put() before return from a5psw_pcs_get(). Fixes: 888cdb8 ("net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220630014153.1888811-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 34eff17 commit 5a24389

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/dsa/rzn1_a5psw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,12 +917,14 @@ static int a5psw_pcs_get(struct a5psw *a5psw)
917917
}
918918

919919
a5psw->pcs[reg] = pcs;
920+
of_node_put(pcs_node);
920921
}
921922
of_node_put(ports);
922923

923924
return 0;
924925

925926
free_pcs:
927+
of_node_put(pcs_node);
926928
of_node_put(port);
927929
of_node_put(ports);
928930
a5psw_pcs_free(a5psw);

0 commit comments

Comments
 (0)