]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
kernel/sysctl.c: code cleanups
authorOla N. Kaldestad <mail@okal.no>
Fri, 17 Nov 2017 23:30:26 +0000 (15:30 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Nov 2017 00:10:03 +0000 (16:10 -0800)
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 <mail@okal.no>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/sysctl.c

index dd25d90896fc835499528c3948fa393310776bf3..557d4672857793f746b9dfe0d8d1a0527bd2ac87 100644 (file)
@@ -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 */