summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2015-11-26 15:23:49 +0100
committerDavid S. Miller <davem@davemloft.net>2015-11-30 21:26:22 +0100
commit42e6b89ce4e8a4f02a1e906694d81acf60db6f4d (patch)
tree47e399d185e96f60884ba4efcae6700d256b15f2 /net/ipv4/ipmr.c
parentnet: ipmr: move pimsm_enabled to pim.h and rename (diff)
downloadlinux-42e6b89ce4e8a4f02a1e906694d81acf60db6f4d.tar.xz
linux-42e6b89ce4e8a4f02a1e906694d81acf60db6f4d.zip
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>
Diffstat (limited to 'net/ipv4/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 322fdc6ac75b..6c24a16299c7 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -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) {