[net-next] xprtrdma: Fix error return code in rpcrdma_buffer_create()
diff mbox series

Message ID 1547635124-62243-1-git-send-email-weiyongjun1@huawei.com
State New
Headers show
Series
  • [net-next] xprtrdma: Fix error return code in rpcrdma_buffer_create()
Related show

Commit Message

Wei Yongjun Jan. 16, 2019, 10:38 a.m. UTC
Fix to return a negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 6d2d0ee27c7a ("xprtrdma: Replace rpcrdma_receive_wq with a per-xprt workqueue")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 net/sunrpc/xprtrdma/verbs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Chuck Lever Jan. 16, 2019, 3:18 p.m. UTC | #1
On Jan 16, 2019, at 5:38 AM, Wei Yongjun <weiyongjun1@huawei.com> wrote:

> Fix to return a negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: 6d2d0ee27c7a ("xprtrdma: Replace rpcrdma_receive_wq with a per-xprt workqueue")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

I thought we'd already fixed this one, but:

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


> ---
> net/sunrpc/xprtrdma/verbs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
> index 7749a2b..3dde058 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -1113,8 +1113,10 @@ struct rpcrdma_req *
> 						WQ_MEM_RECLAIM | WQ_HIGHPRI,
> 						0,
> 			r_xprt->rx_xprt.address_strings[RPC_DISPLAY_ADDR]);
> -	if (!buf->rb_completion_wq)
> +	if (!buf->rb_completion_wq) {
> +		rc = -ENOMEM;
> 		goto out;
> +	}
> 
> 	return 0;
> out:


--
Chuck Lever

Patch
diff mbox series

diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 7749a2b..3dde058 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1113,8 +1113,10 @@  struct rpcrdma_req *
 						WQ_MEM_RECLAIM | WQ_HIGHPRI,
 						0,
 			r_xprt->rx_xprt.address_strings[RPC_DISPLAY_ADDR]);
-	if (!buf->rb_completion_wq)
+	if (!buf->rb_completion_wq) {
+		rc = -ENOMEM;
 		goto out;
+	}
 
 	return 0;
 out: