]> www.infradead.org Git - users/willy/pagecache.git/commit
net: mv643xx_eth: fix an OF node reference leak
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Sat, 21 Dec 2024 08:14:48 +0000 (17:14 +0900)
committerJakub Kicinski <kuba@kernel.org>
Tue, 31 Dec 2024 01:40:34 +0000 (17:40 -0800)
commitad5c318086e2e23b577eca33559c5ebf89bc7eb9
treefa408429d4e78c584a3b2ea12fb74b4ed029d224
parentfb3a9a1165cea104b5ab3753e88218e4497b01c1
net: mv643xx_eth: fix an OF node reference leak

Current implementation of mv643xx_eth_shared_of_add_port() calls
of_parse_phandle(), but does not release the refcount on error. Call
of_node_put() in the error path and in mv643xx_eth_shared_of_remove().

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

Fixes: 76723bca2802 ("net: mv643xx_eth: add DT parsing support")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://patch.msgid.link/20241221081448.3313163-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/mv643xx_eth.c