From c4bd722431e77ccd665f0f1bb1f4d2e6b4c12a74 Mon Sep 17 00:00:00 2001 From: Subash Abhinov Kasiviswanathan Date: Mon, 11 May 2020 19:41:08 -0600 Subject: [PATCH] core: Hold on to module reference Do not remove module if the dependent modules are removed. CRs-Fixed: 2683697 Change-Id: I35539aff061fe57a85f0bb8eb3dcf40499eca760 Signed-off-by: Subash Abhinov Kasiviswanathan --- core/rmnet_config.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/rmnet_config.c b/core/rmnet_config.c index 4e8910e747ba..95208b6e6df6 100644 --- a/core/rmnet_config.c +++ b/core/rmnet_config.c @@ -761,6 +761,8 @@ static int __init rmnet_init(void) } rmnet_core_genl_init(); + + try_module_get(THIS_MODULE); return rc; } @@ -769,6 +771,8 @@ static void __exit rmnet_exit(void) unregister_netdevice_notifier(&rmnet_dev_notifier); rtnl_link_unregister(&rmnet_link_ops); rmnet_core_genl_deinit(); + + module_put(THIS_MODULE); } module_init(rmnet_init)