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


Groups > linux.kernel > #1243058 > unrolled thread

[patch 1/2] misc: mic/scif: fix error code in scif_create_remote_lookup()

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2015-10-09 08:50 +0200
Last post2015-10-11 11:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [patch 1/2] misc: mic/scif: fix error code in  scif_create_remote_lookup() Dan Carpenter <dan.carpenter@oracle.com> - 2015-10-09 08:50 +0200
    Re: [patch 1/2] misc: mic/scif: fix error code in  scif_create_remote_lookup() Sudeep Dutt <sudeep.dutt@intel.com> - 2015-10-11 11:20 +0200

#1243058 — [patch 1/2] misc: mic/scif: fix error code in scif_create_remote_lookup()

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-10-09 08:50 +0200
Subject[patch 1/2] misc: mic/scif: fix error code in scif_create_remote_lookup()
Message-ID<qhzF7-2KD-9@gated-at.bofh.it>
We should be returning -ENOMEM here instead of success.

Fixes: ba612aa8b487 ('misc: mic: SCIF memory registration and unregistration')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/misc/mic/scif/scif_rma.c b/drivers/misc/mic/scif/scif_rma.c
index e288996..bc2dccb 100644
--- a/drivers/misc/mic/scif/scif_rma.c
+++ b/drivers/misc/mic/scif/scif_rma.c
@@ -386,16 +386,20 @@ static int scif_create_remote_lookup(struct scif_dev *remote_dev,
 				    remote_dev, window->nr_lookup *
 				    sizeof(*window->dma_addr_lookup.lookup),
 				    GFP_KERNEL | __GFP_ZERO);
-	if (!window->dma_addr_lookup.lookup)
+	if (!window->dma_addr_lookup.lookup) {
+		err = -ENOMEM;
 		goto error_window;
+	}
 
 	window->num_pages_lookup.lookup =
 		scif_alloc_coherent(&window->num_pages_lookup.offset,
 				    remote_dev, window->nr_lookup *
 				    sizeof(*window->num_pages_lookup.lookup),
 				    GFP_KERNEL | __GFP_ZERO);
-	if (!window->num_pages_lookup.lookup)
+	if (!window->num_pages_lookup.lookup) {
+		err = -ENOMEM;
 		goto error_window;
+	}
 
 	vmalloc_dma_phys = is_vmalloc_addr(&window->dma_addr[0]);
 	vmalloc_num_pages = is_vmalloc_addr(&window->num_pages[0]);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1244080

FromSudeep Dutt <sudeep.dutt@intel.com>
Date2015-10-11 11:20 +0200
Message-ID<qikXo-3XV-7@gated-at.bofh.it>
In reply to#1243058
On Fri, 2015-10-09 at 09:41 +0300, Dan Carpenter wrote:
> We should be returning -ENOMEM here instead of success.
> 

Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com>

Thanks for the fix!

> Fixes: ba612aa8b487 ('misc: mic: SCIF memory registration and unregistration')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/misc/mic/scif/scif_rma.c b/drivers/misc/mic/scif/scif_rma.c
> index e288996..bc2dccb 100644
> --- a/drivers/misc/mic/scif/scif_rma.c
> +++ b/drivers/misc/mic/scif/scif_rma.c
> @@ -386,16 +386,20 @@ static int scif_create_remote_lookup(struct scif_dev *remote_dev,
>  				    remote_dev, window->nr_lookup *
>  				    sizeof(*window->dma_addr_lookup.lookup),
>  				    GFP_KERNEL | __GFP_ZERO);
> -	if (!window->dma_addr_lookup.lookup)
> +	if (!window->dma_addr_lookup.lookup) {
> +		err = -ENOMEM;
>  		goto error_window;
> +	}
>  
>  	window->num_pages_lookup.lookup =
>  		scif_alloc_coherent(&window->num_pages_lookup.offset,
>  				    remote_dev, window->nr_lookup *
>  				    sizeof(*window->num_pages_lookup.lookup),
>  				    GFP_KERNEL | __GFP_ZERO);
> -	if (!window->num_pages_lookup.lookup)
> +	if (!window->num_pages_lookup.lookup) {
> +		err = -ENOMEM;
>  		goto error_window;
> +	}
>  
>  	vmalloc_dma_phys = is_vmalloc_addr(&window->dma_addr[0]);
>  	vmalloc_num_pages = is_vmalloc_addr(&window->num_pages[0]);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web