提交 424c1b68 编写于 作者: T Thomas Gleixner 提交者: Paul E. McKenney

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: NThomas Gleixner <tglx@linutronix.de>
Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
上级 f0bf8fab
...@@ -1023,8 +1023,10 @@ rcu_torture_reader(void *arg) ...@@ -1023,8 +1023,10 @@ rcu_torture_reader(void *arg)
cond_resched(); cond_resched();
stutter_wait("rcu_torture_reader"); stutter_wait("rcu_torture_reader");
} while (!torture_must_stop()); } while (!torture_must_stop());
if (irqreader && cur_ops->irq_capable) if (irqreader && cur_ops->irq_capable) {
del_timer_sync(&t); del_timer_sync(&t);
destroy_timer_on_stack(&t);
}
torture_kthread_stopping("rcu_torture_reader"); torture_kthread_stopping("rcu_torture_reader");
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册