rcutorture: Better bounds checking for n_barrier_cbs
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 14 May 2015 22:35:43 +0000 (15:35 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 15 Jul 2015 21:47:14 +0000 (14:47 -0700)
A negative value for rcutorture.n_barrier_cbs can pass a negative value
to the memory allocator, so this commit instead causes rcu_barrier()
testing to be disabled in this case.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/rcutorture.c

index 59e32684c23b58714ecb26215856f67866cfc58e..7e29a3266139e2a5bd351387895076f6d2680ed5 100644 (file)
@@ -1507,7 +1507,7 @@ static int rcu_torture_barrier_init(void)
        int i;
        int ret;
 
-       if (n_barrier_cbs == 0)
+       if (n_barrier_cbs <= 0)
                return 0;
        if (cur_ops->call == NULL || cur_ops->cb_barrier == NULL) {
                pr_alert("%s" TORTURE_FLAG