aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd/svc.c')
-rw-r--r--fs/lockd/svc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 154a107cd376..fc4084ef4736 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -335,12 +335,17 @@ static struct notifier_block lockd_inet6addr_notifier = {
335}; 335};
336#endif 336#endif
337 337
338static void lockd_svc_exit_thread(void) 338static void lockd_unregister_notifiers(void)
339{ 339{
340 unregister_inetaddr_notifier(&lockd_inetaddr_notifier); 340 unregister_inetaddr_notifier(&lockd_inetaddr_notifier);
341#if IS_ENABLED(CONFIG_IPV6) 341#if IS_ENABLED(CONFIG_IPV6)
342 unregister_inet6addr_notifier(&lockd_inet6addr_notifier); 342 unregister_inet6addr_notifier(&lockd_inet6addr_notifier);
343#endif 343#endif
344}
345
346static void lockd_svc_exit_thread(void)
347{
348 lockd_unregister_notifiers();
344 svc_exit_thread(nlmsvc_rqst); 349 svc_exit_thread(nlmsvc_rqst);
345} 350}
346 351
@@ -462,7 +467,7 @@ int lockd_up(struct net *net)
462 * Note: svc_serv structures have an initial use count of 1, 467 * Note: svc_serv structures have an initial use count of 1,
463 * so we exit through here on both success and failure. 468 * so we exit through here on both success and failure.
464 */ 469 */
465err_net: 470err_put:
466 svc_destroy(serv); 471 svc_destroy(serv);
467err_create: 472err_create:
468 mutex_unlock(&nlmsvc_mutex); 473 mutex_unlock(&nlmsvc_mutex);
@@ -470,7 +475,9 @@ err_create:
470 475
471err_start: 476err_start:
472 lockd_down_net(serv, net); 477 lockd_down_net(serv, net);
473 goto err_net; 478err_net:
479 lockd_unregister_notifiers();
480 goto err_put;
474} 481}
475EXPORT_SYMBOL_GPL(lockd_up); 482EXPORT_SYMBOL_GPL(lockd_up);
476 483