aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_tunnel.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ip_tunnel.c')
-rw-r--r--net/ipv4/ip_tunnel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index bd41dd1948b6..bda4bb8ae260 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -764,9 +764,14 @@ int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd)
764 764
765 t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type); 765 t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type);
766 766
767 if (!t && (cmd == SIOCADDTUNNEL)) { 767 if (cmd == SIOCADDTUNNEL) {
768 t = ip_tunnel_create(net, itn, p); 768 if (!t) {
769 err = PTR_ERR_OR_ZERO(t); 769 t = ip_tunnel_create(net, itn, p);
770 err = PTR_ERR_OR_ZERO(t);
771 break;
772 }
773
774 err = -EEXIST;
770 break; 775 break;
771 } 776 }
772 if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) { 777 if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {