summaryrefslogtreecommitdiff
path: root/drivers/resctrl
diff options
context:
space:
mode:
authorBen Horgan <ben.horgan@arm.com>2026-04-14 14:27:56 +0100
committerJames Morse <james.morse@arm.com>2026-04-17 17:48:07 +0100
commit67c0a487efa542cca9477ea84915db2e091f98d0 (patch)
tree34e09e558e7bf3a9c66ea502312139cb7c4248c7 /drivers/resctrl
parentf758340da529ccb12531c3f83d5992e912f6c8d5 (diff)
arm_mpam: resctrl: Fix the check for no monitor components found
Dan Carpenter reports that, in mpam_resctrl_alloc_domain(), any_mon_comp is used in an 'if' condition when it may be uninitialized. Initialize it to NULL so that the check behaves correctly when no monitor components are found. Reported-by: Dan Carpenter <error27@gmail.com> Fixes: 264c285999fc ("arm_mpam: resctrl: Add monitor initialisation and domain boilerplate") Signed-off-by: Ben Horgan <ben.horgan@arm.com> Reviewed-by: Gavin Shan <gshan@redhat.com> Signed-off-by: James Morse <james.morse@arm.com>
Diffstat (limited to 'drivers/resctrl')
-rw-r--r--drivers/resctrl/mpam_resctrl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
index 4205fb2ee312..1b0b37da12af 100644
--- a/drivers/resctrl/mpam_resctrl.c
+++ b/drivers/resctrl/mpam_resctrl.c
@@ -1407,7 +1407,7 @@ mpam_resctrl_alloc_domain(unsigned int cpu, struct mpam_resctrl_res *res)
}
if (r->mon_capable) {
- struct mpam_component *any_mon_comp;
+ struct mpam_component *any_mon_comp = NULL;
struct mpam_resctrl_mon *mon;
enum resctrl_event_id eventid;