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