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: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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) {