Commit 549b39a9 authored by Geliang Tang's avatar Geliang Tang Committed by Tony Luck

pstore: add vmalloc error check

If vmalloc fails, make write_pmsg return -ENOMEM.
Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 7379047d
......@@ -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; ) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment