]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerConor Dooley <conor.dooley@microchip.com>
Fri, 6 Feb 2026 19:54:27 +0000 (19:54 +0000)
commit3c85234b979af71cb9db5eb976ea08a468415767
tree1bfaac232086a319db73ee643d14b72ea1d62cd2
parentff4b6bf7eef4f5b921eed78f2816abcc55bcdd68
cache: starfive: fix device node leak in starlink_cache_init()

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>
drivers/cache/starfive_starlink_cache.c