xprtrdma: Fix error code in rpcrdma_buffer_create()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 5 Jan 2019 13:06:07 +0000 (16:06 +0300)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 8 Jan 2019 17:06:17 +0000 (12:06 -0500)
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>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtrdma/verbs.c

index 7749a2bf6887764c0956ac404b53f055043c32c3..3dde05892c8ea983f0f84a9f954d8d3ab4224a61 100644 (file)
@@ -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: