diff mbox series

[1/2] xprtrdma: Fix error code in rpcrdma_buffer_create()

Message ID 20190105130607.GB3288@kadam (mailing list archive)
State New, archived
Headers show
Series [1/2] xprtrdma: Fix error code in rpcrdma_buffer_create() | expand

Commit Message

Dan Carpenter Jan. 5, 2019, 1:06 p.m. UTC
This should return -ENOMEM if __alloc_workqueue_key() fails, but it
returns success.

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

Comments

Chuck Lever Jan. 5, 2019, 4:17 p.m. UTC | #1
> On Jan 5, 2019, at 8:06 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> This should return -ENOMEM if __alloc_workqueue_key() fails, but it
> returns success.
> 
> Fixes: 6d2d0ee27c7a ("xprtrdma: Replace rpcrdma_receive_wq with a per-xprt workqueue")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Indeed.

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 7749a2bf6887..3dde05892c8e 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -1113,8 +1113,10 @@ rpcrdma_buffer_create(struct rpcrdma_xprt *r_xprt)
> 						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:
> -- 
> 2.17.1
> 

--
Chuck Lever
diff mbox series

Patch

diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 7749a2bf6887..3dde05892c8e 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1113,8 +1113,10 @@  rpcrdma_buffer_create(struct rpcrdma_xprt *r_xprt)
 						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: