diff options
author | Roland Dreier <rolandd@cisco.com> | 2005-10-24 13:53:25 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2005-10-24 13:53:25 -0400 |
commit | 5d7edb3c1a01310725d86f0d83fb3be45685dc82 (patch) | |
tree | bbe21779313fea41eb644e0e0f06d5949cd4ed49 /drivers/infiniband | |
parent | e7d311da9cba1e113f82176130d3af1be77dc3ee (diff) |
[IB] Add idr_destroy() calls on module unload
Add idr_destroy() calls to the module_exit() functions of the four IB
driver modules that use idrs, so we don't leak idr_layer_cache objects
when these modules are unloaded.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/cm.c | 1 | ||||
-rw-r--r-- | drivers/infiniband/core/sa_query.c | 1 | ||||
-rw-r--r-- | drivers/infiniband/core/ucm.c | 1 | ||||
-rw-r--r-- | drivers/infiniband/core/uverbs_main.c | 7 |
4 files changed, 10 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 54db6d4831f1..151ef83cc14f 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c | |||
@@ -3323,6 +3323,7 @@ static void __exit ib_cm_cleanup(void) | |||
3323 | flush_workqueue(cm.wq); | 3323 | flush_workqueue(cm.wq); |
3324 | destroy_workqueue(cm.wq); | 3324 | destroy_workqueue(cm.wq); |
3325 | ib_unregister_client(&cm_client); | 3325 | ib_unregister_client(&cm_client); |
3326 | idr_destroy(&cm.local_id_table); | ||
3326 | } | 3327 | } |
3327 | 3328 | ||
3328 | module_init(ib_cm_init); | 3329 | module_init(ib_cm_init); |
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index 262618210c1c..e215cf0478d6 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c | |||
@@ -975,6 +975,7 @@ static int __init ib_sa_init(void) | |||
975 | static void __exit ib_sa_cleanup(void) | 975 | static void __exit ib_sa_cleanup(void) |
976 | { | 976 | { |
977 | ib_unregister_client(&sa_client); | 977 | ib_unregister_client(&sa_client); |
978 | idr_destroy(&query_idr); | ||
978 | } | 979 | } |
979 | 980 | ||
980 | module_init(ib_sa_init); | 981 | module_init(ib_sa_init); |
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c index d0f0b0a2edd3..5a6ba4030d44 100644 --- a/drivers/infiniband/core/ucm.c +++ b/drivers/infiniband/core/ucm.c | |||
@@ -1320,6 +1320,7 @@ static void __exit ib_ucm_cleanup(void) | |||
1320 | class_destroy(ib_ucm_class); | 1320 | class_destroy(ib_ucm_class); |
1321 | cdev_del(&ib_ucm_cdev); | 1321 | cdev_del(&ib_ucm_cdev); |
1322 | unregister_chrdev_region(IB_UCM_DEV, 1); | 1322 | unregister_chrdev_region(IB_UCM_DEV, 1); |
1323 | idr_destroy(&ctx_id_table); | ||
1323 | } | 1324 | } |
1324 | 1325 | ||
1325 | module_init(ib_ucm_init); | 1326 | module_init(ib_ucm_init); |
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 12511808de21..add45f7faa5b 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
@@ -762,6 +762,13 @@ static void __exit ib_uverbs_cleanup(void) | |||
762 | unregister_filesystem(&uverbs_event_fs); | 762 | unregister_filesystem(&uverbs_event_fs); |
763 | class_unregister(&uverbs_class); | 763 | class_unregister(&uverbs_class); |
764 | unregister_chrdev_region(IB_UVERBS_BASE_DEV, IB_UVERBS_MAX_DEVICES); | 764 | unregister_chrdev_region(IB_UVERBS_BASE_DEV, IB_UVERBS_MAX_DEVICES); |
765 | idr_destroy(&ib_uverbs_pd_idr); | ||
766 | idr_destroy(&ib_uverbs_mr_idr); | ||
767 | idr_destroy(&ib_uverbs_mw_idr); | ||
768 | idr_destroy(&ib_uverbs_ah_idr); | ||
769 | idr_destroy(&ib_uverbs_cq_idr); | ||
770 | idr_destroy(&ib_uverbs_qp_idr); | ||
771 | idr_destroy(&ib_uverbs_srq_idr); | ||
765 | } | 772 | } |
766 | 773 | ||
767 | module_init(ib_uverbs_init); | 774 | module_init(ib_uverbs_init); |