linux-stable/arch/x86/kernel/cpu/resctrl
Dan Carpenter cc5277fe66 x86/resctrl: Fix a NULL vs IS_ERR() static checker warning in rdt_cdp_peer_get()
The callers don't expect *d_cdp to be set to an error pointer, they only
check for NULL.  This leads to a static checker warning:

  arch/x86/kernel/cpu/resctrl/rdtgroup.c:2648 __init_one_rdt_domain()
  warn: 'd_cdp' could be an error pointer

This would not trigger a bug in this specific case because
__init_one_rdt_domain() calls it with a valid domain that would not have
a negative id and thus not trigger the return of the ERR_PTR(). If this
was a negative domain id then the call to rdt_find_domain() in
domain_add_cpu() would have returned the ERR_PTR() much earlier and the
creation of the domain with an invalid id would have been prevented.

Even though a bug is not triggered currently the right and safe thing to
do is to set the pointer to NULL because that is what can be checked for
when the caller is handling the CDP and non-CDP cases.

Fixes: 52eb74339a ("x86/resctrl: Fix rdt_find_domain() return value and checks")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Link: https://lkml.kernel.org/r/20200602193611.GA190851@mwanda
2020-06-17 12:18:34 +02:00
..
core.c x86/resctrl: Fix memory bandwidth counter width for AMD 2020-06-15 09:35:38 +02:00
ctrlmondata.c x86/resctrl: Maintain MBM counter width per resource 2020-05-06 18:00:35 +02:00
internal.h x86/resctrl: Fix memory bandwidth counter width for AMD 2020-06-15 09:35:38 +02:00
Makefile x86/resctrl: Avoid confusion over the new X86_RESCTRL config 2019-02-02 10:34:52 +01:00
monitor.c x86/resctrl: Support wider MBM counters 2020-05-06 18:08:32 +02:00
pseudo_lock.c mmap locking API: convert mmap_sem comments 2020-06-09 09:39:14 -07:00
pseudo_lock_event.h
rdtgroup.c x86/resctrl: Fix a NULL vs IS_ERR() static checker warning in rdt_cdp_peer_get() 2020-06-17 12:18:34 +02:00