提交 7367633f 编写于 作者: J Jan Kiszka 提交者: Ingo Molnar

efi/capsule: Remove pr_debug() on ENOMEM or EFAULT

Both cases are not worth a debug log message - the error code is telling
enough.
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: NMatt Fleming <matt@codeblueprint.co.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20170602135207.21708-4-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 fb153dc5
...@@ -88,10 +88,8 @@ static ssize_t efi_capsule_setup_info(struct capsule_info *cap_info, ...@@ -88,10 +88,8 @@ static ssize_t efi_capsule_setup_info(struct capsule_info *cap_info,
temp_page = krealloc(cap_info->pages, temp_page = krealloc(cap_info->pages,
pages_needed * sizeof(void *), pages_needed * sizeof(void *),
GFP_KERNEL | __GFP_ZERO); GFP_KERNEL | __GFP_ZERO);
if (!temp_page) { if (!temp_page)
pr_debug("%s: krealloc() failed\n", __func__);
return -ENOMEM; return -ENOMEM;
}
cap_info->pages = temp_page; cap_info->pages = temp_page;
cap_info->header_obtained = true; cap_info->header_obtained = true;
...@@ -111,10 +109,8 @@ static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info) ...@@ -111,10 +109,8 @@ static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info)
cap_hdr_temp = vmap(cap_info->pages, cap_info->index, cap_hdr_temp = vmap(cap_info->pages, cap_info->index,
VM_MAP, PAGE_KERNEL); VM_MAP, PAGE_KERNEL);
if (!cap_hdr_temp) { if (!cap_hdr_temp)
pr_debug("%s: vmap() failed\n", __func__);
return -ENOMEM; return -ENOMEM;
}
ret = efi_capsule_update(cap_hdr_temp, cap_info->pages); ret = efi_capsule_update(cap_hdr_temp, cap_info->pages);
vunmap(cap_hdr_temp); vunmap(cap_hdr_temp);
...@@ -171,7 +167,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff, ...@@ -171,7 +167,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff,
if (!cap_info->page_bytes_remain) { if (!cap_info->page_bytes_remain) {
page = alloc_page(GFP_KERNEL); page = alloc_page(GFP_KERNEL);
if (!page) { if (!page) {
pr_debug("%s: alloc_page() failed\n", __func__);
ret = -ENOMEM; ret = -ENOMEM;
goto failed; goto failed;
} }
...@@ -184,7 +179,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff, ...@@ -184,7 +179,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff,
kbuff = kmap(page); kbuff = kmap(page);
if (!kbuff) { if (!kbuff) {
pr_debug("%s: kmap() failed\n", __func__);
ret = -ENOMEM; ret = -ENOMEM;
goto failed; goto failed;
} }
...@@ -193,7 +187,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff, ...@@ -193,7 +187,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff,
/* Copy capsule binary data from user space to kernel space buffer */ /* Copy capsule binary data from user space to kernel space buffer */
write_byte = min_t(size_t, count, cap_info->page_bytes_remain); write_byte = min_t(size_t, count, cap_info->page_bytes_remain);
if (copy_from_user(kbuff, buff, write_byte)) { if (copy_from_user(kbuff, buff, write_byte)) {
pr_debug("%s: copy_from_user() failed\n", __func__);
ret = -EFAULT; ret = -EFAULT;
goto fail_unmap; goto fail_unmap;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册