IB/hfi1: fix error paths in hfi1_mod_init()
Subsystems (2)
PATCH v2 1/1 IB/hfi1: fix error paths in hfi1_mod_init()
The error path in hfi1_mod_init() is not completed. Fix this by add some goto label.
Fixes d63730192f59 ("IB/hfi1: Reserve and collapse CPU cores for contexts")
Fixes 48a615dc00ae ("IB/hfi1: Integrate OPFN into RC transactions")
Signed-off-by Wanhui Fu <[email protected]>
---
Changes in v2:
- Add Fixes tags as suggested by Sashiko.
--- drivers/infiniband/hw/hfi1/init.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hfi1/init.c +8 -4
@@ -1388,7 +1388,7 @@ static int __init hfi1_mod_init(void) ret =node_affinity_init ();if (ret) - goto bail; + goto bail_dev;/* validate max MTU before any devices start */ if (!valid_opa_max_mtu (hfi1_max_mtu)) {
@@ -1438,7 +1438,7 @@ static int __init hfi1_mod_init(void) ret =opfn_init ();if (ret <0 ) {pr_err ("Failed to allocate opfn_wq" ); - goto bail_dev; + goto bail_affinity; }/*
@@ -1449,12 +1449,16 @@ static int __init hfi1_mod_init(void) ret =pci_register_driver (&hfi1_pci_driver);if (ret <0 ) {pr_err ("Unable to register driver: error %d\n" , -ret); - goto bail_dev; + goto bail_opfn; } goto bail;/* all OK */ -bail_dev: +bail_opfn:hfi1_dbg_exit (); +opfn_exit (); +bail_affinity: +node_affinity_destroy_all (); +bail_dev:dev_cleanup (); bail:return ret;
Signature · 1 line
2.25.1
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 6 lines
The error path in
hfi1_mod_init()is not completed. Fix this by add some goto label.Fixes d63730192f59 ("IB/hfi1: Reserve and collapse CPU cores for contexts")Fixes 48a615dc00ae ("IB/hfi1: Integrate OPFN into RC transactions")Signed-off-by Wanhui Fu <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Leon Romanovsky
AppliedQuoted 2 lines · Wanhui Fu
The error path in
hfi1_mod_init()is not completed. Fix this by add some goto label.
Applied, thanks!
[1/1] IB/hfi1: fix error paths in hfi1_mod_init()
https://git.kernel.org/rdma/rdma/c/c18b5f8b77fbba
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>