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

Weigang He geoffreyhe2 at gmail.com
Fri Sep 25 10:32:50 PDT 2026


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
-- 
2.43.0




More information about the linux-arm-kernel mailing list