Skip to content

Commit 67c0a48

Browse files
benhor01James Morse
authored andcommitted
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 <[email protected]> Fixes: 264c285 ("arm_mpam: resctrl: Add monitor initialisation and domain boilerplate") Signed-off-by: Ben Horgan <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Signed-off-by: James Morse <[email protected]>
1 parent f758340 commit 67c0a48

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/resctrl/mpam_resctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ mpam_resctrl_alloc_domain(unsigned int cpu, struct mpam_resctrl_res *res)
14071407
}
14081408

14091409
if (r->mon_capable) {
1410-
struct mpam_component *any_mon_comp;
1410+
struct mpam_component *any_mon_comp = NULL;
14111411
struct mpam_resctrl_mon *mon;
14121412
enum resctrl_event_id eventid;
14131413

0 commit comments

Comments
 (0)