Skip to content
Snippets Groups Projects
Commit 4050eb86 authored by Luo Meng's avatar Luo Meng Committed by Greg Kroah-Hartman
Browse files

fail_function: Remove a redundant mutex unlock


[ Upstream commit 2801a5da ]

Fix a mutex_unlock() issue where before copy_from_user() is
not called mutex_locked.

Fixes: 4b1a29a7 ("error-injection: Support fault injection framework")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarLuo Meng <luomeng12@huawei.com>
Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/bpf/160570737118.263807.8358435412898356284.stgit@devnote2


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6a5a1010
No related branches found
No related tags found
2 merge requests!337Remove vdo part of tps6598x_rx_identity_reg struct,!262Stable/5.9.11
......@@ -253,7 +253,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,
if (copy_from_user(buf, buffer, count)) {
ret = -EFAULT;
goto out;
goto out_free;
}
buf[count] = '\0';
sym = strstrip(buf);
......@@ -307,8 +307,9 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,
ret = count;
}
out:
kfree(buf);
mutex_unlock(&fei_lock);
out_free:
kfree(buf);
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment