linux/drivers/resctrl
Guangshuo Li 977f52909c arm_mpam: guard MBWU state before adding it to garbage
__destroy_component_cfg() adds each RIS mbwu_state object to the MPAM
garbage list when destroying component configuration.

However, mbwu_state is allocated per RIS and only for RISes with MBWU
monitors. A component can therefore have comp->cfg allocated while some
RISes still have ris->mbwu_state set to NULL.

Passing a NULL mbwu_state to add_to_garbage() dereferences the NULL
pointer inside the macro.

Skip RISes that do not have an mbwu_state object before adding them to
the garbage list.

Fixes: 41e8a14950 ("arm_mpam: Track bandwidth counter state for power management")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
2026-07-16 14:46:27 +01:00
..
Kconfig arm64: mpam: Select ARCH_HAS_CPU_RESCTRL 2026-03-27 15:32:11 +00:00
Makefile arm64: mpam: Select ARCH_HAS_CPU_RESCTRL 2026-03-27 15:32:11 +00:00
mpam_devices.c arm_mpam: guard MBWU state before adding it to garbage 2026-07-16 14:46:27 +01:00
mpam_internal.h arm_mpam: Pretend that NRDY is always hardware managed 2026-05-14 09:51:50 +01:00
mpam_resctrl.c arm_mpam: resctrl: Make resctrl_mon_ctx_waiters static 2026-04-17 17:48:07 +01:00
test_mpam_devices.c arm_mpam: Force __iomem casts 2026-03-13 14:17:30 +00:00
test_mpam_resctrl.c arm_mpam: resctrl: Add kunit test for control format conversions 2026-03-27 15:31:04 +00:00