projects
/
wrapfs-4.14.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9589cb
)
fail_function: Remove a redundant mutex unlock
author
Luo Meng
<luomeng12@huawei.com>
Wed, 18 Nov 2020 13:49:31 +0000
(22:49 +0900)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 24 Nov 2020 12:29:18 +0000
(13:29 +0100)
[ Upstream commit
2801a5da5b25b7af9dd2addd19b2315c02d17b64
]
Fix a mutex_unlock() issue where before copy_from_user() is
not called mutex_locked.
Fixes: 4b1a29a7f542 ("error-injection: Support fault injection framework")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Luo Meng <luomeng12@huawei.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link:
https://lore.kernel.org/bpf/160570737118.263807.8358435412898356284.stgit@devnote2
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/fail_function.c
patch
|
blob
|
history
diff --git
a/kernel/fail_function.c
b/kernel/fail_function.c
index 63b349168da7255a13cbaadca263922a9826b581..b0b1ad93fa957c246033f93f69cddfa15b5c0775 100644
(file)
--- a/
kernel/fail_function.c
+++ b/
kernel/fail_function.c
@@
-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;
}