aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorArtem Savkov <artem.savkov@gmail.com>2016-02-07 07:31:39 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-31 16:39:51 -0400
commite6fb1fc1085e5b5155bc8f3d3385c48b8bdde95e (patch)
tree2879f06cb02b7c9a466eeb3cde9b4e361bde044f /kernel/rcu
parentdba6f1bab8920a6f78b0dc21976afdecf82fba3f (diff)
rcuperf: Do not wake up shutdown wait queue if "shutdown" is false.
After finishing its tests rcuperf tries to wake up shutdown_wq even if "shutdown" param is set to false, resulting in a wake_up() call on an unitialized wait_queue_head_t which leads to "BUG: spinlock bad magic" and "BUG: unable to handle kernel NULL pointer dereference". Fix by checking "shutdown" param before waking up the queue. Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/rcuperf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
index 4c0572859ff0..3cee0d8393ed 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -423,8 +423,10 @@ rcu_perf_writer(void *arg)
423 b_rcu_perf_writer_finished = 423 b_rcu_perf_writer_finished =
424 cur_ops->completed(); 424 cur_ops->completed();
425 } 425 }
426 smp_mb(); /* Assign before wake. */ 426 if (shutdown) {
427 wake_up(&shutdown_wq); 427 smp_mb(); /* Assign before wake. */
428 wake_up(&shutdown_wq);
429 }
428 } 430 }
429 } 431 }
430 if (done && !alldone && 432 if (done && !alldone &&