Commit 8de9399a authored by Dan Carpenter's avatar Dan Carpenter Committed by Doug Ledford

RDMA/bnxt_re: Fix an error code in bnxt_qplib_create_srq()

We should return -ENOMEM if the allocation fails.  (The current code
returns succees).

Fixes: 37cb11ac ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-By: default avatarDevesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 589ccd8b
...@@ -557,8 +557,10 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, ...@@ -557,8 +557,10 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq), srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq),
GFP_KERNEL); GFP_KERNEL);
if (!srq->swq) if (!srq->swq) {
rc = -ENOMEM;
goto fail; goto fail;
}
RCFW_CMD_PREP(req, CREATE_SRQ, cmd_flags); RCFW_CMD_PREP(req, CREATE_SRQ, cmd_flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment