summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2017-06-28 16:09:38 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-06-28 16:09:38 +0300
commit3b58a3c72f484393c65995a551902945f5a18c70 (patch)
tree0c0020b487f9263d146c35d4329d52928879a4f7 /kernel
parent441dae8f2f2975c68101a84bc3f528ec95ecf7c3 (diff)
downloadlinux-3b58a3c72f484393c65995a551902945f5a18c70.tar.xz
ftrace: Unlock hash mutex on failed allocation in process_mod_list()
If the new_hash fails to allocate, then unlock the hash mutex on error. Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 7509ef9810bf..2c79630cd267 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3997,7 +3997,7 @@ static void process_mod_list(struct list_head *head, struct ftrace_ops *ops,
new_hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS,
*orig_hash);
if (!new_hash)
- return; /* Warn? */
+ goto out; /* warn? */
mutex_lock(&ftrace_lock);
@@ -4042,6 +4042,7 @@ static void process_mod_list(struct list_head *head, struct ftrace_ops *ops,
new_hash, enable);
mutex_unlock(&ftrace_lock);
+ out:
mutex_unlock(&ops->func_hash->regex_lock);
free_ftrace_hash(new_hash);