Skip to content

Commit 5ac8480

Browse files
Kalesh APjgunthorpe
authored andcommitted
RDMA/bnxt_re: Fix error handling in probe failure path
During bnxt_re_dev_init(), when bnxt_re_setup_chip_ctx() fails unregister with L2 first before bailing out probe. Fixes: ae8637e ("RDMA/bnxt_re: Add chip context to identify 57500 series") Link: https://lore.kernel.org/r/1691642677-21369-3-git-send-email-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>
1 parent 5363fc4 commit 5ac8480

File tree

1 file changed

+2
-0
lines changed
  • drivers/infiniband/hw/bnxt_re

1 file changed

+2
-0
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,8 @@ static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 wqe_mode)
12531253

12541254
rc = bnxt_re_setup_chip_ctx(rdev, wqe_mode);
12551255
if (rc) {
1256+
bnxt_unregister_dev(rdev->en_dev);
1257+
clear_bit(BNXT_RE_FLAG_NETDEV_REGISTERED, &rdev->flags);
12561258
ibdev_err(&rdev->ibdev, "Failed to get chip context\n");
12571259
return -EINVAL;
12581260
}

0 commit comments

Comments
 (0)