Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5802294f authored by Steven Rostedt's avatar Steven Rostedt Committed by Ingo Molnar
Browse files

rcu: trace fix possible mem-leak



In the initialization of the RCU trace module, if
rcupreempt_debugfs_init() fails, we never free the the trace buffer.

This patch frees the trace buffer in case the debugfs fails.

Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
Reviewed-by: default avatar"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent dd0078f4
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -308,11 +308,16 @@ out:

static int __init rcupreempt_trace_init(void)
{
	int ret;

	mutex_init(&rcupreempt_trace_mutex);
	rcupreempt_trace_buf = kmalloc(RCUPREEMPT_TRACE_BUF_SIZE, GFP_KERNEL);
	if (!rcupreempt_trace_buf)
		return 1;
	return rcupreempt_debugfs_init();
	ret = rcupreempt_debugfs_init();
	if (ret)
		kfree(rcupreempt_trace_buf);
	return ret;
}

static void __exit rcupreempt_trace_cleanup(void)