From: Dan Carpenter Date: Tue, 30 Jan 2018 20:40:30 +0000 (+0300) Subject: RDMA/bnxt_re: Fix an error code in bnxt_qplib_create_srq() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=8de9399a24f97af2d3dfa28346f5c302f420bdae;p=openwrt%2Fstaging%2Fblogic.git 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 Acked-By: Devesh Sharma Signed-off-by: Doug Ledford --- 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);