mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-16 18:08:20 +00:00
RDMA/bnxt_re: Fix an error path in bnxt_re_add_device
In bnxt_re_add_device(), when register netdev notifier fails, driver is not unregistering the IB device in the error cleanup path. Also, removed the duplicate cleanup in error path of bnxt_re_probe. Fixes: 94a9dc6ac8f7 ("RDMA/bnxt_re: Group all operations under add_device and remove_device") Link: https://patch.msgid.link/r/1728373302-19530-8-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>
This commit is contained in:
parent
8be3e5b0c9
commit
a5e099e0c4
@ -1880,12 +1880,14 @@ static int bnxt_re_add_device(struct auxiliary_device *adev, u8 op_type)
|
|||||||
rdev->nb.notifier_call = NULL;
|
rdev->nb.notifier_call = NULL;
|
||||||
pr_err("%s: Cannot register to netdevice_notifier",
|
pr_err("%s: Cannot register to netdevice_notifier",
|
||||||
ROCE_DRV_MODULE_NAME);
|
ROCE_DRV_MODULE_NAME);
|
||||||
return rc;
|
goto re_dev_unreg;
|
||||||
}
|
}
|
||||||
bnxt_re_setup_cc(rdev, true);
|
bnxt_re_setup_cc(rdev, true);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
re_dev_unreg:
|
||||||
|
ib_unregister_device(&rdev->ibdev);
|
||||||
re_dev_uninit:
|
re_dev_uninit:
|
||||||
bnxt_re_update_en_info_rdev(NULL, en_info, adev);
|
bnxt_re_update_en_info_rdev(NULL, en_info, adev);
|
||||||
bnxt_re_dev_uninit(rdev, BNXT_RE_COMPLETE_REMOVE);
|
bnxt_re_dev_uninit(rdev, BNXT_RE_COMPLETE_REMOVE);
|
||||||
@ -2029,15 +2031,7 @@ static int bnxt_re_probe(struct auxiliary_device *adev,
|
|||||||
auxiliary_set_drvdata(adev, en_info);
|
auxiliary_set_drvdata(adev, en_info);
|
||||||
|
|
||||||
rc = bnxt_re_add_device(adev, BNXT_RE_COMPLETE_INIT);
|
rc = bnxt_re_add_device(adev, BNXT_RE_COMPLETE_INIT);
|
||||||
if (rc)
|
|
||||||
goto err;
|
|
||||||
mutex_unlock(&bnxt_re_mutex);
|
mutex_unlock(&bnxt_re_mutex);
|
||||||
return 0;
|
|
||||||
|
|
||||||
err:
|
|
||||||
mutex_unlock(&bnxt_re_mutex);
|
|
||||||
bnxt_re_remove(adev);
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user