rcutorture: Bounds-check rcutorture.shuffle_interval
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 14 May 2015 23:55:45 +0000 (16:55 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 15 Jul 2015 21:47:16 +0000 (14:47 -0700)
Specifying a negative rcutorture.shuffle_interval value will cause a
negative value to be used as a sleep time.  This commit therefore
refuses to start shuffling unless the rcutorture.shuffle_interval
value is greater than zero.

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

index 2cbe569ac5dd08a93b5e570008819fb1c18bd86f..1cead7806ca607233b4f95dd2771016251ee78e4 100644 (file)
@@ -1821,7 +1821,7 @@ rcu_torture_init(void)
                if (firsterr)
                        goto unwind;
        }
-       if (test_no_idle_hz) {
+       if (test_no_idle_hz && shuffle_interval > 0) {
                firsterr = torture_shuffle_init(shuffle_interval * HZ);
                if (firsterr)
                        goto unwind;