public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] svcrdma: fix error handling of rdma_alloc_frmr()
@ 2009-06-25  8:35 Wei Yongjun
  2009-06-29 14:55 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2009-06-25  8:35 UTC (permalink / raw)
  To: Neil Brown, J. Bruce Fields, Trond Myklebust, linux-nfs, nfsv4

ib_alloc_fast_reg_mr() and ib_alloc_fast_reg_page_list() returns
ERR_PTR() and not NULL. Compile tested only.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sunrpc/xprtrdma/svc_rdma_transport.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 5151f9f..0cf5e8c 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -730,12 +730,12 @@ static struct svc_rdma_fastreg_mr *rdma_alloc_frmr(struct svcxprt_rdma *xprt)
 		goto err;
 
 	mr = ib_alloc_fast_reg_mr(xprt->sc_pd, RPCSVC_MAXPAGES);
-	if (!mr)
+	if (IS_ERR(mr))
 		goto err_free_frmr;
 
 	pl = ib_alloc_fast_reg_page_list(xprt->sc_cm_id->device,
 					 RPCSVC_MAXPAGES);
-	if (!pl)
+	if (IS_ERR(pl))
 		goto err_free_mr;
 
 	frmr->mr = mr;
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] svcrdma: fix error handling of rdma_alloc_frmr()
  2009-06-25  8:35 [PATCH] svcrdma: fix error handling of rdma_alloc_frmr() Wei Yongjun
@ 2009-06-29 14:55 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2009-06-29 14:55 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: nfsv4, linux-nfs, Trond Myklebust

Thanks, queued up for 2.6.31.  Looks obvious correct, but runtime
testing from anyone would always be appreciated.

--b.

On Thu, Jun 25, 2009 at 04:35:44PM +0800, Wei Yongjun wrote:
> ib_alloc_fast_reg_mr() and ib_alloc_fast_reg_page_list() returns
> ERR_PTR() and not NULL. Compile tested only.
> 
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
> ---
>  net/sunrpc/xprtrdma/svc_rdma_transport.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> index 5151f9f..0cf5e8c 100644
> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> @@ -730,12 +730,12 @@ static struct svc_rdma_fastreg_mr *rdma_alloc_frmr(struct svcxprt_rdma *xprt)
>  		goto err;
>  
>  	mr = ib_alloc_fast_reg_mr(xprt->sc_pd, RPCSVC_MAXPAGES);
> -	if (!mr)
> +	if (IS_ERR(mr))
>  		goto err_free_frmr;
>  
>  	pl = ib_alloc_fast_reg_page_list(xprt->sc_cm_id->device,
>  					 RPCSVC_MAXPAGES);
> -	if (!pl)
> +	if (IS_ERR(pl))
>  		goto err_free_mr;
>  
>  	frmr->mr = mr;
> -- 
> 1.6.2.2
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-29 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-25  8:35 [PATCH] svcrdma: fix error handling of rdma_alloc_frmr() Wei Yongjun
2009-06-29 14:55 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox