Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e78c7bca authored by Michael Kerrisk's avatar Michael Kerrisk Committed by Ingo Molnar
Browse files

sched: Simplify return logic in sched_copy_attr()



The logic in this function is a little contorted, clean it up:

  * Rather than having chained gotos for the -EFBIG case, just
    return -EFBIG directly.

  * Now, the label 'out' is no longer needed, and 'ret' must be zero
    zero by the time we fall through to this point, so just return 0.

Signed-off-by: default avatarMichael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/536CEC24.9080201@gmail.com


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 3944a927
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -3657,13 +3657,11 @@ static int sched_copy_attr(struct sched_attr __user *uattr,
	 */
	attr->sched_nice = clamp(attr->sched_nice, MIN_NICE, MAX_NICE);

out:
	return ret;
	return 0;

err_size:
	put_user(sizeof(*attr), &uattr->size);
	ret = -E2BIG;
	goto out;
	return -E2BIG;
}

/**