[PATCH] proc: sysctl: remove unnecessary jump label in __register_sysctl_table()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The processing path that handles error return value of insert_header(),
can reuse part of normal processing path. So remove the unnecessary
jump label named fail_put_dir_locked.

Signed-off-by: Zeng Heng <zengheng4@xxxxxxxxxx>
---
 fs/proc/proc_sysctl.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 48f2d60bd78a..cae23f9ba98e 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -1329,7 +1329,7 @@ struct ctl_table_header *__register_sysctl_table(
 	struct ctl_dir *dir;
 	struct ctl_table *entry;
 	struct ctl_node *node;
-	int nr_entries = 0;
+	int err, nr_entries = 0;
 
 	list_for_each_table_entry(entry, table)
 		nr_entries++;
@@ -1369,17 +1369,16 @@ struct ctl_table_header *__register_sysctl_table(
 	}
 
 	spin_lock(&sysctl_lock);
-	if (insert_header(dir, header))
-		goto fail_put_dir_locked;
+	err = insert_header(dir, header);
 
 	drop_sysctl_table(&dir->header);
 	spin_unlock(&sysctl_lock);
 
+	if (err)
+		goto fail;
+
 	return header;
 
-fail_put_dir_locked:
-	drop_sysctl_table(&dir->header);
-	spin_unlock(&sysctl_lock);
 fail:
 	kfree(header);
 	dump_stack();
-- 
2.25.1




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux