summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-01-30 23:40:30 +0300
committerDoug Ledford <dledford@redhat.com>2018-02-01 00:19:50 +0300
commit8de9399a24f97af2d3dfa28346f5c302f420bdae (patch)
tree791cb748d0485eba28c647ba7a97c8fe95a46b6c /drivers
parent589ccd8b0404281ebc84fe9a9ae51ddbc6d1a8c1 (diff)
downloadlinux-8de9399a24f97af2d3dfa28346f5c302f420bdae.tar.xz
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: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-By: Devesh Sharma <devesh.sharma@broadcom.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/bnxt_re/qplib_fp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index 8b5f11ac0e42..1b0e94697fe3 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -557,8 +557,10 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq),
GFP_KERNEL);
- if (!srq->swq)
+ if (!srq->swq) {
+ rc = -ENOMEM;
goto fail;
+ }
RCFW_CMD_PREP(req, CREATE_SRQ, cmd_flags);