Skip to content

Commit 497158a

Browse files
selvintxavierjgunthorpe
authored andcommitted
RDMA/bnxt_re: Fix the ib_reg failure cleanup
Release the netdev references in the cleanup path. Invokes the cleanup routines if bnxt_re_ib_reg fails. Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent c354dff commit 497158a

File tree

1 file changed

+4
-1
lines changed
  • drivers/infiniband/hw/bnxt_re

1 file changed

+4
-1
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1416,9 +1416,12 @@ static void bnxt_re_task(struct work_struct *work)
14161416
switch (re_work->event) {
14171417
case NETDEV_REGISTER:
14181418
rc = bnxt_re_ib_reg(rdev);
1419-
if (rc)
1419+
if (rc) {
14201420
dev_err(rdev_to_dev(rdev),
14211421
"Failed to register with IB: %#x", rc);
1422+
bnxt_re_remove_one(rdev);
1423+
bnxt_re_dev_unreg(rdev);
1424+
}
14221425
break;
14231426
case NETDEV_UP:
14241427
bnxt_re_dispatch_event(&rdev->ibdev, NULL, 1,

0 commit comments

Comments
 (0)