提交 42e6b89c 编写于 作者: N Nikolay Aleksandrov 提交者: 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: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1973a4ea
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册