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

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
...@@ -1284,12 +1284,14 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, ...@@ -1284,12 +1284,14 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval,
switch (optname) { switch (optname) {
case MRT_INIT: case MRT_INIT:
if (optlen != sizeof(int)) if (optlen != sizeof(int)) {
ret = -EINVAL; ret = -EINVAL;
if (rtnl_dereference(mrt->mroute_sk)) break;
}
if (rtnl_dereference(mrt->mroute_sk)) {
ret = -EADDRINUSE; ret = -EADDRINUSE;
if (ret)
break; break;
}
ret = ip_ra_control(sk, 1, mrtsock_destruct); ret = ip_ra_control(sk, 1, mrtsock_destruct);
if (ret == 0) { if (ret == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment