1
0
Fork 0

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>
hifive-unleashed-5.1
Thomas Gleixner 2014-03-23 08:58:27 -07:00 committed by Paul E. McKenney
parent f0bf8fab4f
commit 424c1b6820
1 changed files with 3 additions and 1 deletions

View File

@ -1023,8 +1023,10 @@ rcu_torture_reader(void *arg)
cond_resched();
stutter_wait("rcu_torture_reader");
} while (!torture_must_stop());
if (irqreader && cur_ops->irq_capable)
if (irqreader && cur_ops->irq_capable) {
del_timer_sync(&t);
destroy_timer_on_stack(&t);
}
torture_kthread_stopping("rcu_torture_reader");
return 0;
}