diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-01-30 23:40:30 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-01-31 16:19:50 -0500 |
commit | 8de9399a24f97af2d3dfa28346f5c302f420bdae (patch) | |
tree | 791cb748d0485eba28c647ba7a97c8fe95a46b6c /drivers/infiniband/hw | |
parent | 589ccd8b0404281ebc84fe9a9ae51ddbc6d1a8c1 (diff) | |
download | linux-8de9399a24f97af2d3dfa28346f5c302f420bdae.tar.bz2 |
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/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/qplib_fp.c | 4 |
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); |