Skip to content

Commit c5c1ae7

Browse files
kaleshap86rleon
authored andcommitted
RDMA/bnxt_re: Add a check for memory allocation
__alloc_pbl() can return error when memory allocation fails. Driver is not checking the status on one of the instances. Fixes: 0c4dcd6 ("RDMA/bnxt_re: Refactor hardware queue memory allocation") Link: https://patch.msgid.link/r/1726715161-18941-4-git-send-email-selvin.xavier@broadcom.com Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 9ab20f7 commit c5c1ae7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/infiniband/hw/bnxt_re/qplib_res.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ int bnxt_qplib_alloc_init_hwq(struct bnxt_qplib_hwq *hwq,
244244
sginfo.pgsize = npde * pg_size;
245245
sginfo.npages = 1;
246246
rc = __alloc_pbl(res, &hwq->pbl[PBL_LVL_0], &sginfo);
247+
if (rc)
248+
goto fail;
247249

248250
/* Alloc PBL pages */
249251
sginfo.npages = npbl;

0 commit comments

Comments
 (0)