Commit 67c0a487 authored by Ben Horgan's avatar Ben Horgan Committed by James Morse
Browse files

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: default avatarDan Carpenter <error27@gmail.com>
Fixes: 264c2859 ("arm_mpam: resctrl: Add monitor initialisation and domain boilerplate")
Signed-off-by: default avatarBen Horgan <ben.horgan@arm.com>
Reviewed-by: default avatarGavin Shan <gshan@redhat.com>
Signed-off-by: default avatarJames Morse <james.morse@arm.com>
parent f758340d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;