kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2/2] xprtrdma: checking for NULL instead of IS_ERR()
@ 2015-11-05  8:39 Dan Carpenter
  2015-11-05 14:08 ` Chuck Lever
  2015-11-06 18:34 ` Anna Schumaker
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-11-05  8:39 UTC (permalink / raw)
  To: Trond Myklebust, Chuck Lever
  Cc: Jeff Layton, Anna Schumaker, Sagi Grimberg, linux-nfs,
	kernel-janitors

The rpcrdma_create_req() function returns error pointers or success.  It
never returns NULL.

Fixes: f531a5dbc451 ('xprtrdma: Pre-allocate backward rpc_rqst and send/receive buffers')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c
index 2dcb44f..97554ca 100644
--- a/net/sunrpc/xprtrdma/backchannel.c
+++ b/net/sunrpc/xprtrdma/backchannel.c
@@ -42,8 +42,8 @@ static int rpcrdma_bc_setup_rqst(struct rpcrdma_xprt *r_xprt,
 	size_t size;
 
 	req = rpcrdma_create_req(r_xprt);
-	if (!req)
-		return -ENOMEM;
+	if (IS_ERR(req))
+		return PTR_ERR(req);
 	req->rl_backchannel = true;
 
 	size = RPCRDMA_INLINE_WRITE_THRESHOLD(rqst);

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

* Re: [patch 2/2] xprtrdma: checking for NULL instead of IS_ERR()
  2015-11-05  8:39 [patch 2/2] xprtrdma: checking for NULL instead of IS_ERR() Dan Carpenter
@ 2015-11-05 14:08 ` Chuck Lever
  2015-11-06 18:34 ` Anna Schumaker
  1 sibling, 0 replies; 4+ messages in thread
From: Chuck Lever @ 2015-11-05 14:08 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Trond Myklebust, Jeff Layton, Anna Schumaker, Sagi Grimberg,
	Linux NFS Mailing List, kernel-janitors


> On Nov 5, 2015, at 3:39 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> The rpcrdma_create_req() function returns error pointers or success.  It
> never returns NULL.
> 
> Fixes: f531a5dbc451 ('xprtrdma: Pre-allocate backward rpc_rqst and send/receive buffers')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>


> diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c
> index 2dcb44f..97554ca 100644
> --- a/net/sunrpc/xprtrdma/backchannel.c
> +++ b/net/sunrpc/xprtrdma/backchannel.c
> @@ -42,8 +42,8 @@ static int rpcrdma_bc_setup_rqst(struct rpcrdma_xprt *r_xprt,
> 	size_t size;
> 
> 	req = rpcrdma_create_req(r_xprt);
> -	if (!req)
> -		return -ENOMEM;
> +	if (IS_ERR(req))
> +		return PTR_ERR(req);
> 	req->rl_backchannel = true;
> 
> 	size = RPCRDMA_INLINE_WRITE_THRESHOLD(rqst);

—
Chuck Lever



--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [patch 2/2] xprtrdma: checking for NULL instead of IS_ERR()
  2015-11-05  8:39 [patch 2/2] xprtrdma: checking for NULL instead of IS_ERR() Dan Carpenter
  2015-11-05 14:08 ` Chuck Lever
@ 2015-11-06 18:34 ` Anna Schumaker
  2015-11-06 20:04   ` Dan Carpenter
  1 sibling, 1 reply; 4+ messages in thread
From: Anna Schumaker @ 2015-11-06 18:34 UTC (permalink / raw)
  To: Dan Carpenter, Trond Myklebust, Chuck Lever
  Cc: Jeff Layton, Anna Schumaker, Sagi Grimberg, linux-nfs,
	kernel-janitors

On 11/05/2015 03:39 AM, Dan Carpenter wrote:
> The rpcrdma_create_req() function returns error pointers or success.  It
> never returns NULL.
> 
> Fixes: f531a5dbc451 ('xprtrdma: Pre-allocate backward rpc_rqst and send/receive buffers')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, Dan! These patches don't look urgent, so if it's okay with you then I'll save them for 4.5.

Anna

> 
> diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c
> index 2dcb44f..97554ca 100644
> --- a/net/sunrpc/xprtrdma/backchannel.c
> +++ b/net/sunrpc/xprtrdma/backchannel.c
> @@ -42,8 +42,8 @@ static int rpcrdma_bc_setup_rqst(struct rpcrdma_xprt *r_xprt,
>  	size_t size;
>  
>  	req = rpcrdma_create_req(r_xprt);
> -	if (!req)
> -		return -ENOMEM;
> +	if (IS_ERR(req))
> +		return PTR_ERR(req);
>  	req->rl_backchannel = true;
>  
>  	size = RPCRDMA_INLINE_WRITE_THRESHOLD(rqst);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: [patch 2/2] xprtrdma: checking for NULL instead of IS_ERR()
  2015-11-06 18:34 ` Anna Schumaker
@ 2015-11-06 20:04   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-11-06 20:04 UTC (permalink / raw)
  To: Anna Schumaker
  Cc: Trond Myklebust, Chuck Lever, Jeff Layton, Sagi Grimberg,
	linux-nfs, kernel-janitors

On Fri, Nov 06, 2015 at 01:34:50PM -0500, Anna Schumaker wrote:
> On 11/05/2015 03:39 AM, Dan Carpenter wrote:
> > The rpcrdma_create_req() function returns error pointers or success.  It
> > never returns NULL.
> > 
> > Fixes: f531a5dbc451 ('xprtrdma: Pre-allocate backward rpc_rqst and send/receive buffers')
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Thanks, Dan! These patches don't look urgent, so if it's okay with you then I'll save them for 4.5.

To be honest, I only ever care about linux-next and not released
versions.  :P  As long as it's in linux-next I'll be happy.

regards,
dan carpenter


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

end of thread, other threads:[~2015-11-06 20:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05  8:39 [patch 2/2] xprtrdma: checking for NULL instead of IS_ERR() Dan Carpenter
2015-11-05 14:08 ` Chuck Lever
2015-11-06 18:34 ` Anna Schumaker
2015-11-06 20:04   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).