mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 09:04:21 +08:00
cpuacct: Convert BUG_ON() to WARN_ON_ONCE()
Replace fatal BUG_ON() with more safe WARN_ON_ONCE() in cpuacct_cpuusage_read(). Signed-off-by: Andrey Ryabinin <arbn@yandex-team.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20211115164607.23784-2-arbn@yandex-team.com
This commit is contained in:
parent
9731698ecb
commit
c7ccbf4b61
@ -106,7 +106,8 @@ static u64 cpuacct_cpuusage_read(struct cpuacct *ca, int cpu,
|
||||
* We allow index == CPUACCT_STAT_NSTATS here to read
|
||||
* the sum of usages.
|
||||
*/
|
||||
BUG_ON(index > CPUACCT_STAT_NSTATS);
|
||||
if (WARN_ON_ONCE(index > CPUACCT_STAT_NSTATS))
|
||||
return 0;
|
||||
|
||||
#ifndef CONFIG_64BIT
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user