Skip to content

Commit

Permalink
perf/core: Don't release cred_guard_mutex if not taken
Browse files Browse the repository at this point in the history
If we failed to acquire task's cred_guard_mutex we shouldn't proceed
to release it in the error path.

Fixes: a63fbed ("perf/tracing/cpuhotplug: Fix locking order")
Signed-off-by: Alexander Levin <alexander.levin@verizon.com>
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
Cc: mathieu.desnoyers@efficios.com
Cc: mhiramat@kernel.org
Cc: paulmck@linux.vnet.ibm.com
Cc: bigeasy@linutronix.de
Link: http://lkml.kernel.org/r/20170603033903.12056-1-alexander.levin@verizon.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Alexander Levin authored and Thomas Gleixner committed Jun 3, 2017
1 parent 49dfe2a commit e5aeee5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -9878,7 +9878,7 @@ SYSCALL_DEFINE5(perf_event_open,
if (task) {
err = mutex_lock_interruptible(&task->signal->cred_guard_mutex);
if (err)
goto err_cred;
goto err_task;

/*
* Reuse ptrace permission checks for now.
Expand Down

0 comments on commit e5aeee5

Please sign in to comment.