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

Commit 42e6b89c authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller
Browse files

net: ipmr: fix setsockopt error return



We can have both errors and we'll return the second one, fix it to
return an error at a time as it's normal. I've overlooked this in my
previous set.

Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1973a4ea
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1284,12 +1284,14 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval,

	switch (optname) {
	case MRT_INIT:
		if (optlen != sizeof(int))
		if (optlen != sizeof(int)) {
			ret = -EINVAL;
		if (rtnl_dereference(mrt->mroute_sk))
			break;
		}
		if (rtnl_dereference(mrt->mroute_sk)) {
			ret = -EADDRINUSE;
		if (ret)
			break;
		}

		ret = ip_ra_control(sk, 1, mrtsock_destruct);
		if (ret == 0) {