Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1636747

Re: [PATCH 1/1 linux-next] efi/capsule: kmap() can't fail

From Matt Fleming <matt@codeblueprint.co.uk>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1 linux-next] efi/capsule: kmap() can't fail
Date 2017-05-05 23:30 +0200
Message-ID <tDSXv-7fU-9@gated-at.bofh.it> (permalink)
References <tAde9-88w-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/1 linux-next] efi/capsule: kmap() can't fail Fabian Frederick <fabf@skynet.be> - 2017-04-25 20:20 +0200
  Re: [PATCH 1/1 linux-next] efi/capsule: kmap() can't fail Matt Fleming <matt@codeblueprint.co.uk> - 2017-05-05 23:30 +0200

csiph-web