summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-01-12 01:29:29 +0100
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-31 22:34:07 +0200
commitec3833ed02ae6ef2a933ece9de7cbab0c64c699e (patch)
treef8fbd7a547108972415b53cab77755b599422275 /kernel
parentrcu: Remove expedited GP funnel-lock bypass (diff)
downloadlinux-ec3833ed02ae6ef2a933ece9de7cbab0c64c699e.tar.xz
linux-ec3833ed02ae6ef2a933ece9de7cbab0c64c699e.zip
rcu: Force boolean subscript for expedited stall warnings
The cpu_online() function can return values other than 0 and 1, which can result in subscript overflow when applied to a two-element array. This commit allows for this behavior by using "!!" on the return value from cpu_online() when used as a subscript. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcu/tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 62e73e0a929f..64c2e3288551 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3808,7 +3808,7 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp)
ndetected++;
rdp = per_cpu_ptr(rsp->rda, cpu);
pr_cont(" %d-%c%c%c", cpu,
- "O."[cpu_online(cpu)],
+ "O."[!!cpu_online(cpu)],
"o."[!!(rdp->grpmask & rnp->expmaskinit)],
"N."[!!(rdp->grpmask & rnp->expmaskinitnext)]);
}