projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7379047
)
pstore: add vmalloc error check
author
Geliang Tang
<geliangtang@163.com>
Tue, 20 Oct 2015 07:39:01 +0000
(
00:39
-0700)
committer
Tony Luck
<tony.luck@intel.com>
Wed, 21 Oct 2015 16:27:10 +0000
(09:27 -0700)
If vmalloc fails, make write_pmsg return -ENOMEM.
Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
fs/pstore/pmsg.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/pstore/pmsg.c
b/fs/pstore/pmsg.c
index feb5dd2948b4e4ef7a5857e51389194617f49d76..5a2f05a16c1e3aee45877345f3f998eb9c68a9d3 100644
(file)
--- a/
fs/pstore/pmsg.c
+++ b/
fs/pstore/pmsg.c
@@
-37,6
+37,8
@@
static ssize_t write_pmsg(struct file *file, const char __user *buf,
if (buffer_size > PMSG_MAX_BOUNCE_BUFFER_SIZE)
buffer_size = PMSG_MAX_BOUNCE_BUFFER_SIZE;
buffer = vmalloc(buffer_size);
+ if (!buffer)
+ return -ENOMEM;
mutex_lock(&pmsg_lock);
for (i = 0; i < count; ) {