[patch] svcrdma: signedness bug in xprt_rdma_bc_send_request()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The "len" variable was unsigned so the error handling didn't work.  Also
"len" was a misleading name because it's either a negative error code or
it's zero.  It's never actually a length.  I've renamed it to "ret".

Fixes: eb57be60eca9 ('svcrdma: Add class for RDMA backwards direction transport')
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
index 417cec1..deff06a 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
@@ -240,7 +240,7 @@ xprt_rdma_bc_send_request(struct rpc_task *task)
 	struct rpc_rqst *rqst = task->tk_rqstp;
 	struct svc_xprt *sxprt = rqst->rq_xprt->bc_xprt;
 	struct svcxprt_rdma *rdma;
-	u32 len;
+	int ret;
 
 	dprintk("svcrdma: sending bc call with xid: %08x\n",
 		be32_to_cpu(rqst->rq_xid));
@@ -252,15 +252,15 @@ xprt_rdma_bc_send_request(struct rpc_task *task)
 		rpc_wake_up_queued_task(&sxprt->xpt_bc_pending, task);
 	}
 
-	len = -ENOTCONN;
+	ret = -ENOTCONN;
 	rdma = container_of(sxprt, struct svcxprt_rdma, sc_xprt);
 	if (!test_bit(XPT_DEAD, &sxprt->xpt_flags))
-		len = rpcrdma_bc_send_request(rdma, rqst);
+		ret = rpcrdma_bc_send_request(rdma, rqst);
 
 	mutex_unlock(&sxprt->xpt_mutex);
 
-	if (len < 0)
-		return len;
+	if (ret < 0)
+		return ret;
 	return 0;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux