Commit 171fd022 authored by Fabian Frederick's avatar Fabian Frederick Committed by Ingo Molnar

efi/capsule: Remove NULL test on kmap()

kmap() can't fail.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Kweh Hock Leong <hock.leong.kweh@intel.com>
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-8-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 82c3768b
...@@ -170,10 +170,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff, ...@@ -170,10 +170,6 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff,
page = cap_info->pages[cap_info->index - 1]; page = cap_info->pages[cap_info->index - 1];
kbuff = kmap(page); kbuff = kmap(page);
if (!kbuff) {
ret = -ENOMEM;
goto failed;
}
kbuff += PAGE_SIZE - cap_info->page_bytes_remain; kbuff += PAGE_SIZE - cap_info->page_bytes_remain;
/* Copy capsule binary data from user space to kernel space buffer */ /* Copy capsule binary data from user space to kernel space buffer */
......
...@@ -247,10 +247,6 @@ int efi_capsule_update(efi_capsule_header_t *capsule, struct page **pages) ...@@ -247,10 +247,6 @@ int efi_capsule_update(efi_capsule_header_t *capsule, struct page **pages)
efi_capsule_block_desc_t *sglist; efi_capsule_block_desc_t *sglist;
sglist = kmap(sg_pages[i]); sglist = kmap(sg_pages[i]);
if (!sglist) {
rv = -ENOMEM;
goto out;
}
for (j = 0; j < SGLIST_PER_PAGE && count > 0; j++) { for (j = 0; j < SGLIST_PER_PAGE && count > 0; j++) {
u64 sz = min_t(u64, imagesize, PAGE_SIZE); u64 sz = min_t(u64, imagesize, PAGE_SIZE);
......
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