]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Mon, 16 Dec 2024 07:49:23 +0000 (16:49 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:49:56 +0000 (12:49 +0100)
commit0e833dc042b94f75c27997f18900d0560328ba6e
tree8127b8ae17a98ab8eb16eead97f54ca06f345cd4
parent4efb30e564f239e5767af5bdd28a36e0e85ac670
leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()

[ Upstream commit 0508316be63bb735f59bdc8fe4527cadb62210ca ]

netxbig_leds_get_of_pdata() does not release the OF node obtained by
of_parse_phandle() when of_find_device_by_node() fails. Add an
of_node_put() call to fix the leak.

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

Fixes: 9af512e81964 ("leds: netxbig: Convert to use GPIO descriptors")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20241216074923.628509-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/leds/leds-netxbig.c