aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-03-23 11:58:27 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-05-14 12:46:24 -0400
commit424c1b682051c48e1da24e503b96a8a72e114ea4 (patch)
tree1c4c6780b76d625a2d124580a87619d1bc7f1a94 /kernel/rcu
parentf0bf8fab4f311cffa869a462ffd182465c4caee6 (diff)
rcutorture: Add missing destroy_timer_on_stack()
The rcu_torture_reader() function uses an on-stack timer_list structure which it initializes with setup_timer_on_stack(). However, it fails to use destroy_timer_on_stack() before exiting, which results in leaking a tracking object if DEBUG_OBJECTS is enabled. This commit therefore invokes destroy_timer_on_stack() to avoid this leakage. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/rcutorture.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 8b2748486c17..a7d18069a96d 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1023,8 +1023,10 @@ rcu_torture_reader(void *arg)
1023 cond_resched(); 1023 cond_resched();
1024 stutter_wait("rcu_torture_reader"); 1024 stutter_wait("rcu_torture_reader");
1025 } while (!torture_must_stop()); 1025 } while (!torture_must_stop());
1026 if (irqreader && cur_ops->irq_capable) 1026 if (irqreader && cur_ops->irq_capable) {
1027 del_timer_sync(&t); 1027 del_timer_sync(&t);
1028 destroy_timer_on_stack(&t);
1029 }
1028 torture_kthread_stopping("rcu_torture_reader"); 1030 torture_kthread_stopping("rcu_torture_reader");
1029 return 0; 1031 return 0;
1030} 1032}