]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ethernet: bgmac-platform: fix an OF node reference leak
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Sat, 14 Dec 2024 01:49:12 +0000 (10:49 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 12:52:55 +0000 (13:52 +0100)
commit2d5b7d2c4390eff91c8c618c3f9748fc12b13db8
tree4b50d9102733bee38bbe970dbf5cd6c7c73fdc8d
parente6fc9ff94548489557fc55aa989a2fd82dcee2eb
net: ethernet: bgmac-platform: fix an OF node reference leak

[ Upstream commit 0cb2c504d79e7caa3abade3f466750c82ad26f01 ]

The OF node obtained by of_parse_phandle() is not freed. Call
of_node_put() to balance the refcount.

This bug was found by an experimental static analysis tool that I am
developing.

Fixes: 1676aba5ef7e ("net: ethernet: bgmac: device tree phy enablement")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20241214014912.2810315-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bgmac-platform.c