From: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
To: Fabian Frederick <fabf-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
Cc: Ard Biesheuvel
<ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Kweh Hock Leong
<hock.leong.kweh-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 1/1 linux-next] efi/capsule: kmap() can't fail
Date: Fri, 5 May 2017 22:21:45 +0100 [thread overview]
Message-ID: <20170505212145.GE5225@codeblueprint.co.uk> (raw)
In-Reply-To: <20170425181051.2187-1-fabf-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
On Tue, 25 Apr, at 08:10:51PM, Fabian Frederick wrote:
> Remove NULL test on kmap()
>
> Signed-off-by: Fabian Frederick <fabf-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
> ---
> drivers/firmware/efi/capsule-loader.c | 5 -----
> drivers/firmware/efi/capsule.c | 4 ----
> 2 files changed, 9 deletions(-)
>
> diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
> index 9ae6c11..bf8b2ef 100644
> --- a/drivers/firmware/efi/capsule-loader.c
> +++ b/drivers/firmware/efi/capsule-loader.c
> @@ -183,11 +183,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) {
> - pr_debug("%s: kmap() failed\n", __func__);
> - ret = -EFAULT;
> - 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 6eedff4..e603ccf 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);
Huh, well I didn't know that.
This looks OK to me. Applied, thanks.
WARNING: multiple messages have this Message-ID (diff)
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Fabian Frederick <fabf@skynet.be>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
Kweh Hock Leong <hock.leong.kweh@intel.com>
Subject: Re: [PATCH 1/1 linux-next] efi/capsule: kmap() can't fail
Date: Fri, 5 May 2017 22:21:45 +0100 [thread overview]
Message-ID: <20170505212145.GE5225@codeblueprint.co.uk> (raw)
In-Reply-To: <20170425181051.2187-1-fabf@skynet.be>
On Tue, 25 Apr, at 08:10:51PM, Fabian Frederick wrote:
> Remove NULL test on kmap()
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> drivers/firmware/efi/capsule-loader.c | 5 -----
> drivers/firmware/efi/capsule.c | 4 ----
> 2 files changed, 9 deletions(-)
>
> diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
> index 9ae6c11..bf8b2ef 100644
> --- a/drivers/firmware/efi/capsule-loader.c
> +++ b/drivers/firmware/efi/capsule-loader.c
> @@ -183,11 +183,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) {
> - pr_debug("%s: kmap() failed\n", __func__);
> - ret = -EFAULT;
> - 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 6eedff4..e603ccf 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);
Huh, well I didn't know that.
This looks OK to me. Applied, thanks.
next prev parent reply other threads:[~2017-05-05 21:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 18:10 [PATCH 1/1 linux-next] efi/capsule: kmap() can't fail Fabian Frederick
2017-04-25 18:10 ` Fabian Frederick
[not found] ` <20170425181051.2187-1-fabf-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
2017-05-05 21:21 ` Matt Fleming [this message]
2017-05-05 21:21 ` Matt Fleming
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=20170505212145.GE5225@codeblueprint.co.uk \
--to=matt-mf/unelci9gs6ibeejttw/xrex20p6io@public.gmane.org \
--cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=fabf-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org \
--cc=hock.leong.kweh-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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.