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 <subashab@codeaurora.org>
This commit is contained in:
Subash Abhinov Kasiviswanathan
2020-05-11 19:41:08 -06:00
parent fa1352fa7a
commit c4bd722431

View File

@@ -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)