arm_mpam: resctrl: mpam resctrl glue code fixes
Ben Horgan
maintainercover arm_mpam: resctrl: mpam resctrl glue code fixes
A couple of minor fixes for the new mpam resctrl glue code. These fix a sparse warning and and use of an unitialized variable in an unexpected error case.
Thanks for the bug reports.
Based on arm64 for-next/mpam.git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/mpam
Ben Horgan (2):
arm_mpam: resctrl: Fix the check for no monitor components found
arm_mpam: resctrl: Make resctrl_mon_ctx_waiters static
drivers/resctrl/mpam_resctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.43.0
Ben Horgan
maintainerPATCH 1/2 arm_mpam: resctrl: Fix broken error path in mpam_resctrl_alloc_domain()
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.
--- drivers/resctrl/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/resctrl/mpam_resctrl.c +1 -1
@@ -1399,7 +1399,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;
Signature · 1 line
2.43.0
Ben Horgan
maintainerRe: [PATCH v1 1/2] arm_mpam: resctrl: Fix broken error path in mpam_resctrl_alloc_domain()
Apologies, I just sent the same patch twice with different subjects. This one can be ignored.
Thanks,
Ben
Quoted 25 lines · Ben Horgan
Dan Carpenter reports that, in
mpam_resctrl_alloc_domain(),any_mon_compis 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 264c285999fc ("arm_mpam: resctrl: Add monitor initialisation and domain boilerplate")Signed-off-by Ben Horgan <[email protected]>--- drivers/resctrl/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/resctrl/mpam_resctrl.c +1
-1@@ -1399,7 +1399,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;
Ben Horgan
maintainerPATCH 1/2 arm_mpam: resctrl: Fix the check for no monitor components found
In reply to Ben HorganDan 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.
--- drivers/resctrl/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/resctrl/mpam_resctrl.c +1 -1
@@ -1399,7 +1399,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;
Signature · 1 line
2.43.0
Re: [PATCH v1 1/2] arm_mpam: resctrl: Fix the check for no monitor components found
Quoted 5 lines · Ben Horgan
Dan Carpenter reports that, in
mpam_resctrl_alloc_domain(),any_mon_compis 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.
Quoted 7 lines
Reported-by Dan Carpenter <[email protected]>Fixes 264c285999fc ("arm_mpam: resctrl: Add monitor initialisation and domain boilerplate")Signed-off-by Ben Horgan <[email protected]>--- drivers/resctrl/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Ben Horgan
maintainerPATCH 2/2 arm_mpam: resctrl: Make resctrl_mon_ctx_waiters static
In reply to Ben Horganresctrl_mon_ctx_waiters is not used outside of this file, so make it static. This fixes the sparse warning:
drivers/resctrl/mpam_resctrl.c:25:1: warning: symbol 'resctrl_mon_ctx_waiters' was not declared. Should it be static?
--- drivers/resctrl/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/resctrl/mpam_resctrl.c +1 -1
@@ -22,7 +22,7 @@#include "mpam_internal.h" -DECLARE_WAIT_QUEUE_HEAD (resctrl_mon_ctx_waiters); +static DECLARE_WAIT_QUEUE_HEAD (resctrl_mon_ctx_waiters);/* * The classes we've picked to map to resctrl resources, wrapped
Signature · 1 line
2.43.0
Re: [PATCH v1 2/2] arm_mpam: resctrl: Make resctrl_mon_ctx_waiters static
Quoted 5 lines · Ben Horgan
resctrl_mon_ctx_waitersis not used outside of this file, so make it static. This fixes the sparse warning:
drivers/resctrl/mpam_resctrl.c:25:1: warning: symbol 'resctrl_mon_ctx_waiters' was not declared. Should it be static?
Quoted 8 lines
Reported-by kernel test robot <[email protected]>Fixes 2a3c79c61539 ("arm_mpam: resctrl: Allow resctrl to allocate monitors")Signed-off-by Ben Horgan <[email protected]>--- drivers/resctrl/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)