From: Ola N. Kaldestad Date: Fri, 17 Nov 2017 23:30:26 +0000 (-0800) Subject: kernel/sysctl.c: code cleanups X-Git-Tag: Ubuntu-5.2.0-15.16~5525^2~22 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f9eb2fdd04d4e68fbea18970bbf65ace716d25b6;p=mirror_ubuntu-eoan-kernel.git kernel/sysctl.c: code cleanups Remove unnecessary else block, remove redundant return and call to kfree in if block. Link: http://lkml.kernel.org/r/1510238435-1655-1-git-send-email-mail@okal.no Signed-off-by: Ola N. Kaldestad Acked-by: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sysctl.c b/kernel/sysctl.c index dd25d90896fc..557d46728577 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -3127,14 +3127,12 @@ int proc_do_large_bitmap(struct ctl_table *table, int write, else bitmap_copy(bitmap, tmp_bitmap, bitmap_len); } - kfree(tmp_bitmap); *lenp -= left; *ppos += *lenp; - return 0; - } else { - kfree(tmp_bitmap); - return err; } + + kfree(tmp_bitmap); + return err; } #else /* CONFIG_PROC_SYSCTL */