All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: linux-efi@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H . Peter Anvin" <hpa@zytor.com>
Cc: Fabian Frederick <fabf@skynet.be>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	linux-kernel@vger.kernel.org,
	Kweh Hock Leong <hock.leong.kweh@intel.com>,
	Matt Fleming <matt@codeblueprint.co.uk>
Subject: [PATCH 07/13] efi/capsule: Remove NULL test on kmap()
Date: Fri,  2 Jun 2017 13:52:01 +0000	[thread overview]
Message-ID: <20170602135207.21708-8-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20170602135207.21708-1-ard.biesheuvel@linaro.org>

From: Fabian Frederick <fabf@skynet.be>

kmap() can't fail.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Kweh Hock Leong <hock.leong.kweh@intel.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 drivers/firmware/efi/capsule-loader.c | 4 ----
 drivers/firmware/efi/capsule.c        | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
index 5b012a467d7d..2357bcdcb44d 100644
--- a/drivers/firmware/efi/capsule-loader.c
+++ b/drivers/firmware/efi/capsule-loader.c
@@ -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];
 
 	kbuff = kmap(page);
-	if (!kbuff) {
-		ret = -ENOMEM;
-		goto failed;
-	}
 	kbuff += PAGE_SIZE - cap_info->page_bytes_remain;
 
 	/* Copy capsule binary data from user space to kernel space buffer */
diff --git a/drivers/firmware/efi/capsule.c b/drivers/firmware/efi/capsule.c
index 6eedff45e6d7..e603ccf39d80 100644
--- a/drivers/firmware/efi/capsule.c
+++ b/drivers/firmware/efi/capsule.c
@@ -247,10 +247,6 @@ int efi_capsule_update(efi_capsule_header_t *capsule, struct page **pages)
 		efi_capsule_block_desc_t *sglist;
 
 		sglist = kmap(sg_pages[i]);
-		if (!sglist) {
-			rv = -ENOMEM;
-			goto out;
-		}
 
 		for (j = 0; j < SGLIST_PER_PAGE && count > 0; j++) {
 			u64 sz = min_t(u64, imagesize, PAGE_SIZE);
-- 
2.9.3

  parent reply	other threads:[~2017-06-02 13:55 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02 13:51 [GIT PULL 00/13] First batch of EFI updates for v4.13 Ard Biesheuvel
2017-06-02 13:51 ` [PATCH 01/13] x86/efi: Clean up efi CR3 save/restore Ard Biesheuvel
2017-06-02 13:51   ` Ard Biesheuvel
2017-06-05 15:40   ` Ingo Molnar
2017-06-05 15:40     ` Ingo Molnar
2017-06-05 16:03     ` Ard Biesheuvel
2017-06-05 16:03       ` Ard Biesheuvel
2017-06-05 16:14       ` Andy Lutomirski
2017-06-02 13:51 ` [PATCH 02/13] efi/capsule: Fix return code on failing kmap/vmap Ard Biesheuvel
2017-06-05 17:10   ` [tip:efi/core] " tip-bot for Jan Kiszka
2017-06-02 13:51 ` [PATCH 03/13] efi/capsule: Remove pr_debug on ENOMEM or EFAULT Ard Biesheuvel
2017-06-02 13:51   ` Ard Biesheuvel
2017-06-05 17:10   ` [tip:efi/core] efi/capsule: Remove pr_debug() " tip-bot for Jan Kiszka
2017-06-02 13:51 ` [PATCH 04/13] efi/capsule: Clean up pr_err/info messages Ard Biesheuvel
2017-06-05 17:11   ` [tip:efi/core] efi/capsule: Clean up pr_err/_info() messages tip-bot for Jan Kiszka
2017-06-02 13:51 ` [PATCH 05/13] efi/capsule: Adjust return type of efi_capsule_setup_info Ard Biesheuvel
2017-06-05 17:12   ` [tip:efi/core] efi/capsule: Adjust return type of efi_capsule_setup_info() tip-bot for Jan Kiszka
2017-06-02 13:52 ` [PATCH 06/13] efi/capsule-loader: Use a cached copy of the capsule header Ard Biesheuvel
2017-06-05 17:12   ` [tip:efi/core] " tip-bot for Ard Biesheuvel
2017-06-02 13:52 ` Ard Biesheuvel [this message]
2017-06-05 17:13   ` [tip:efi/core] efi/capsule: Remove NULL test on kmap() tip-bot for Fabian Frederick
2017-06-02 13:52 ` [PATCH 08/13] efi/capsule-loader: Redirect calls to efi_capsule_setup_info via weak alias Ard Biesheuvel
2017-06-05 17:13   ` [tip:efi/core] efi/capsule-loader: Redirect calls to efi_capsule_setup_info() " tip-bot for Ard Biesheuvel
2017-06-02 13:52 ` [PATCH 09/13] efi/capsule-loader: Use page addresses rather than struct page pointers Ard Biesheuvel
2017-06-02 13:52   ` Ard Biesheuvel
2017-06-05 17:14   ` [tip:efi/core] " tip-bot for Ard Biesheuvel
2017-06-02 13:52 ` [PATCH 10/13] efi/capsule: Add support for Quark security header Ard Biesheuvel
2017-06-05 15:50   ` Ingo Molnar
2017-06-05 16:00     ` Ard Biesheuvel
2017-06-05 16:00       ` Ard Biesheuvel
2017-06-05 16:11       ` Ingo Molnar
2017-06-05 17:14   ` [tip:efi/core] " tip-bot for Jan Kiszka
2017-06-02 13:52 ` [PATCH 11/13] efi/efi_test: Use memdup_user() helper Ard Biesheuvel
2017-06-02 13:52   ` Ard Biesheuvel
2017-06-05 17:15   ` [tip:efi/core] " tip-bot for Geliang Tang
2017-06-02 13:52 ` [PATCH 12/13] x86/efi: Add EFI_PGT_DUMP support for x86_32 and kexec Ard Biesheuvel
2017-06-05 17:16   ` [tip:efi/core] x86/efi: Extend CONFIG_EFI_PGT_DUMP support to x86_32 and kexec as well tip-bot for Sai Praneeth
2017-06-02 13:52 ` [PATCH 13/13] efi: arm: enable DMI/SMBIOS Ard Biesheuvel
2017-06-05 17:16   ` [tip:efi/core] efi/arm: Enable DMI/SMBIOS tip-bot for Ard Biesheuvel
2017-06-05  8:15 ` [GIT PULL 00/13] First batch of EFI updates for v4.13 Ard Biesheuvel
2017-06-05  9:07   ` Ingo Molnar
2017-06-05  9:07     ` Ingo Molnar
2017-06-05  9:35     ` Ard Biesheuvel
2017-06-05  9:35       ` Ard Biesheuvel
2017-06-05 15:53       ` Ingo Molnar
2017-06-05 15:53         ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170602135207.21708-8-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=fabf@skynet.be \
    --cc=hock.leong.kweh@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.