RDMA/bnxt_re: Fix an error code in bnxt_qplib_create_srq()
Subsystems (3)
PATCH 1/1 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).
drivers/infiniband/hw/bnxt_re/qplib_fp.c +3 -1
@@ -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);
Quoted 11 lines · Dan Carpenter
We should return
-ENOMEMif the allocation fails. (The current code returns succees).Fixes 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")Signed-off-by Dan Carpenter <[email protected]>drivers/infiniband/hw/bnxt_re/qplib_fp.c +0
-0
drivers/infiniband/hw/bnxt_re/qplib_fp.c int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, · line 563
Quoted 8 lines
drivers/infiniband/hw/bnxt_re/qplib_fp.c +3
-1@@ -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; + }
Opps!! my bad. Thanks for fixing.
drivers/infiniband/hw/bnxt_re/qplib_fp.c int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, · line 566
Quoted 3 lines
drivers/infiniband/hw/bnxt_re/qplib_fp.c +0
-0RCFW_CMD_PREP (req,CREATE_SRQ , cmd_flags);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Doug Ledford
AppliedQuoted 23 lines · Devesh Sharma
Quoted 11 lines · Dan Carpenter
We should return
-ENOMEMif the allocation fails. (The current code returns succees).Fixes 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")Signed-off-by Dan Carpenter <[email protected]>drivers/infiniband/hw/bnxt_re/qplib_fp.c +0
-0drivers/infiniband/hw/bnxt_re/qplib_fp.c int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, · line 563
Quoted 8 lines
drivers/infiniband/hw/bnxt_re/qplib_fp.c +3
-1@@ -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; + }Opps!! my bad. Thanks for fixing.
Quoted 1 line
Acked-by Devesh Sharma <[email protected]>
Thanks, applied.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD