diff options
author | Michael Kerrisk <mtk.manpages@gmail.com> | 2014-05-09 10:54:33 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-05-22 05:16:27 -0400 |
commit | 22400674945c562cf3c176d6c4178cd545e2dec9 (patch) | |
tree | b4a2ee1a6165661e51b47aaed35b4acd3b4e784e /kernel | |
parent | e78c7bca56dab5ce4f22694f99115ec07e4935f6 (diff) |
sched: Simplify return logic in sched_read_attr()
Gotos are chained pointlessly here, and the 'out' label
can be dispensed with.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/536CEC29.9090503@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2318fc484d8b..a78c5b62a470 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -3821,7 +3821,7 @@ static int sched_read_attr(struct sched_attr __user *uattr, | |||
3821 | 3821 | ||
3822 | for (; addr < end; addr++) { | 3822 | for (; addr < end; addr++) { |
3823 | if (*addr) | 3823 | if (*addr) |
3824 | goto err_size; | 3824 | return -EFBIG; |
3825 | } | 3825 | } |
3826 | 3826 | ||
3827 | attr->size = usize; | 3827 | attr->size = usize; |
@@ -3831,12 +3831,7 @@ static int sched_read_attr(struct sched_attr __user *uattr, | |||
3831 | if (ret) | 3831 | if (ret) |
3832 | return -EFAULT; | 3832 | return -EFAULT; |
3833 | 3833 | ||
3834 | out: | 3834 | return 0; |
3835 | return ret; | ||
3836 | |||
3837 | err_size: | ||
3838 | ret = -E2BIG; | ||
3839 | goto out; | ||
3840 | } | 3835 | } |
3841 | 3836 | ||
3842 | /** | 3837 | /** |