Skip to contentSkip to conversation

RDMA/cma: add missed unregister_pernet_subsys in init failure

PATCH Superseded Chuhong Yuan 2 participants 2 messages Dec 5, 2019 InfiniBand

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/cma: add missed unregister_pernet_subsys in init failure

The driver forgets to call unregister_pernet_subsys() in the error path of cma_init().
Add the missed call to fix it.

---
 drivers/infiniband/core/cma.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/core/cma.c +1 -0
index 25f2b70fd8ef..43a6f07e0afe 100644
@@ -4763,6 +4763,7 @@ static int __init cma_init(void)
 err:
 	unregister_netdevice_notifier(&cma_nb);
 	ib_sa_unregister_client(&sa_client);
+	unregister_pernet_subsys(&cma_pernet_operations);
 err_wq:
 	destroy_workqueue(cma_wq);
 	return ret;
Signature · 1 line
2.24.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines

From: [email protected] <linux-kernel- [email protected]> On Behalf Of Chuhong Yuan
Sent: Thursday, December 5, 2019 10:07 AM
The driver forgets to call unregister_pernet_subsys() in the error path of cma_init().
Add the missed call to fix it.

---
 drivers/infiniband/core/cma.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/core/cma.c +1 -1
index 25f2b70fd8ef..43a6f07e0afe 100644
@@ -4763,6 +4763,7 @@ static int __init cma_init(void)
 err:
 	unregister_netdevice_notifier(&cma_nb);
 	ib_sa_unregister_client(&sa_client);
+	unregister_pernet_subsys(&cma_pernet_operations);
 err_wq:
 	destroy_workqueue(cma_wq);
 	return ret;
--
Quoted 1 line

2.24.0

Please add to commit log.

Fixes 4be74b42a6d0 ("IB/cma: Separate port allocation to network namespaces ")