mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1973a4ea6c
commit
42e6b89ce4
@ -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))
|
||||
ret = -EADDRINUSE;
|
||||
if (ret)
|
||||
break;
|
||||
}
|
||||
if (rtnl_dereference(mrt->mroute_sk)) {
|
||||
ret = -EADDRINUSE;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = ip_ra_control(sk, 1, mrtsock_destruct);
|
||||
if (ret == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user