]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cache: starfive: fix device node leak in starlink_cache_init()
authorFelix Gu <ustc.gu@gmail.com>
Fri, 30 Jan 2026 17:13:45 +0000 (01:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2026 10:08:51 +0000 (11:08 +0100)
commitbff13109276a6f09b339870714cf97ea0cd7d08d
tree38270aa74d211515dde2cfa317e2918c668ae78d
parentda4b44c42f40501db35f5d0a6243708a061490a0
cache: starfive: fix device node leak in starlink_cache_init()

[ Upstream commit 3c85234b979af71cb9db5eb976ea08a468415767 ]

of_find_matching_node() returns a device_node with refcount incremented.

Use __free(device_node) attribute to automatically call of_node_put()
when the variable goes out of scope, preventing the refcount leak.

Fixes: cabff60ca77d ("cache: Add StarFive StarLink cache management")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cache/starfive_starlink_cache.c