[RHEL7,COMMIT] ms/lockd: double unregister of inetaddr notifiers

Submitted by Konstantin Khorenko on July 4, 2018, 3:44 p.m.

Details

Message ID 201807041544.w64FiSxr009565@finist_ce7.work
State New
Headers show

Patch hide | download patch | download mbox

diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index d2cffb3bbec3..df69095c02dd 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -381,6 +381,7 @@  static int lockd_start_svc(struct svc_serv *serv)
 		printk(KERN_WARNING
 			"lockd_up: svc_rqst allocation failed, error=%d\n",
 			error);
+		lockd_unregister_notifiers();
 		goto out_rqst;
 	}
 
@@ -472,13 +473,16 @@  int lockd_up(struct net *net)
 	}
 
 	error = lockd_up_net(serv, net);
-	if (error < 0)
-		goto err_net;
+	if (error < 0) {
+		lockd_unregister_notifiers();
+		goto err_put;
+	}
 
 	error = lockd_start_svc(serv);
-	if (error < 0)
-		goto err_start;
-
+	if (error < 0) {
+		lockd_down_net(serv, net);
+		goto err_put;
+	}
 	nlmsvc_users++;
 	/*
 	 * Note: svc_serv structures have an initial use count of 1,
@@ -489,12 +493,6 @@  int lockd_up(struct net *net)
 err_create:
 	mutex_unlock(&nlmsvc_mutex);
 	return error;
-
-err_start:
-	lockd_down_net(serv, net);
-err_net:
-	lockd_unregister_notifiers();
-	goto err_put;
 }
 EXPORT_SYMBOL_GPL(lockd_up);