提交 3b58a3c7 编写于 作者: S Steven Rostedt (VMware)

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: NJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
上级 441dae8f
...@@ -3997,7 +3997,7 @@ static void process_mod_list(struct list_head *head, struct ftrace_ops *ops, ...@@ -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, new_hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS,
*orig_hash); *orig_hash);
if (!new_hash) if (!new_hash)
return; /* Warn? */ goto out; /* warn? */
mutex_lock(&ftrace_lock); mutex_lock(&ftrace_lock);
...@@ -4042,6 +4042,7 @@ static void process_mod_list(struct list_head *head, struct ftrace_ops *ops, ...@@ -4042,6 +4042,7 @@ static void process_mod_list(struct list_head *head, struct ftrace_ops *ops,
new_hash, enable); new_hash, enable);
mutex_unlock(&ftrace_lock); mutex_unlock(&ftrace_lock);
out:
mutex_unlock(&ops->func_hash->regex_lock); mutex_unlock(&ops->func_hash->regex_lock);
free_ftrace_hash(new_hash); free_ftrace_hash(new_hash);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册