Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Ben Horgan and committed by
James Morse
67c0a487 f758340d

+1 -1
+1 -1
drivers/resctrl/mpam_resctrl.c
··· 1407 1407 } 1408 1408 1409 1409 if (r->mon_capable) { 1410 - struct mpam_component *any_mon_comp; 1410 + struct mpam_component *any_mon_comp = NULL; 1411 1411 struct mpam_resctrl_mon *mon; 1412 1412 enum resctrl_event_id eventid; 1413 1413