mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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: 264c285999 ("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>
This commit is contained in:
parent
f758340da5
commit
67c0a487ef
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user