All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2/2] xprtrdma: checking for NULL instead of IS_ERR()
@ 2015-11-05  8:39 ` Dan Carpenter
  0 siblings, 0 replies; 8+ 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] 8+ messages in thread

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

Thread overview: 8+ 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  8:39 ` Dan Carpenter
2015-11-05 14:08 ` Chuck Lever
2015-11-05 14:08   ` Chuck Lever
2015-11-06 18:34 ` Anna Schumaker
2015-11-06 18:34   ` Anna Schumaker
2015-11-06 20:04   ` Dan Carpenter
2015-11-06 20:04     ` Dan Carpenter

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.