Skip to content

Commit

Permalink
kernel/sysctl.c: code cleanups
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
korkje authored and torvalds committed Nov 18, 2017
1 parent 2743232 commit f9eb2fd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit f9eb2fd

Please sign in to comment.