Skip to content

ARM: vexpress: fix two device_node refcount leaks

Weigang He linux-arm-kernel lkml 1 version Applied

Status from this message: Applied to sudeep.holla/linux (for-next/vexpress/fixes), thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2ARM: vexpress: fix device_node refcount leak in vexpress_flags_set()arch/arm/mach-versatile/v2m.c+2 -21 reply
2/2ARM: vexpress: fix device_node refcount leak in vexpress_smp_dt_prepare_cpus()arch/arm/mach-versatile/platsmp-vexpress.c+2 -21 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchLiviu Dudau
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] ARM: vexpress: fix two device_node refcount leaks

The Versatile Express SMP bring-up path leaks two device_node references during boot:

- vexpress_flags_set() (mach-versatile/v2m.c) leaks the "arm,vexpress-sysreg" node obtained via of_find_compatible_node().
- vexpress_smp_dt_prepare_cpus() (mach-versatile/platsmp-vexpress.c) leaks the SCU node obtained via of_find_matching_node().

of_iomap() does not take ownership of the node, so each is a one-shot refcount leak with no functional impact. They were introduced by different commits, so they are split into one patch each.

The first leak was reported by static analysis (CodeQL); the second was found while reviewing that report. The CodeQL query was synthesized with LLM assistance, and the patches were drafted with LLM assistance; I have reviewed them.

Compile-tested only (ARCH=arm multi_v7_defconfig, W=1); I have no Versatile Express hardware.

Weigang He (2):
ARM: vexpress: fix device_node refcount leak in vexpress_flags_set()
ARM: vexpress: fix device_node refcount leak in
vexpress_smp_dt_prepare_cpus()

 arch/arm/mach-versatile/platsmp-vexpress.c | 4 ++--
 arch/arm/mach-versatile/v2m.c              | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

base-commit: 165768bb70265b5c38cf0b73fafd75be235f8b14

Signature · 1 line
2.43.0