History

cpuacct: Convert BUG_ON() to WARN_ON_ONCE()

Replace fatal BUG_ON() with more safe WARN_ON_ONCE() in cpuacct_cpuusage_read().

Andrey Ryabinin committed 5 years ago

Commit c7ccbf41 parent 97316981 file · +2 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/sched/cpuacct.c+2−1
@@ -106,7 +106,8 @@ static u64 cpuacct_cpuusage_read(struct cpuacct *ca, int cpu, · 105 unmodified lines
106 * We allow index == CPUACCT_STAT_NSTATS here to read106 * We allow index == CPUACCT_STAT_NSTATS here to read
107 * the sum of usages.107 * the sum of usages.
108 */108 */
109 BUG_ON(index > CPUACCT_STAT_NSTATS);109 if (WARN_ON_ONCE(index > CPUACCT_STAT_NSTATS))
110 return 0;
110 111
111#ifndef CONFIG_64BIT112#ifndef CONFIG_64BIT
112 /*113 /*