Skip to content

Commit f9eb2fd

Browse files
korkjetorvalds
authored andcommitted
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/[email protected] Signed-off-by: Ola N. Kaldestad <[email protected]> Acked-by: Kees Cook <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2743232 commit f9eb2fd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

kernel/sysctl.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,14 +3127,12 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
31273127
else
31283128
bitmap_copy(bitmap, tmp_bitmap, bitmap_len);
31293129
}
3130-
kfree(tmp_bitmap);
31313130
*lenp -= left;
31323131
*ppos += *lenp;
3133-
return 0;
3134-
} else {
3135-
kfree(tmp_bitmap);
3136-
return err;
31373132
}
3133+
3134+
kfree(tmp_bitmap);
3135+
return err;
31383136
}
31393137

31403138
#else /* CONFIG_PROC_SYSCTL */

0 commit comments

Comments
 (0)