Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
[linux-2.6-block.git] / drivers / net / tun.c
index d3ee1994b02f2c6b19b35fa2e4d1d799503aa207..4fdfa2ae5418e6c030be80b5568e3c12dcbbf3f9 100644 (file)
@@ -946,8 +946,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
                char *name;
                unsigned long flags = 0;
 
-               err = -EINVAL;
-
                if (!capable(CAP_NET_ADMIN))
                        return -EPERM;
                err = security_tun_dev_create();
@@ -964,7 +962,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
                        flags |= TUN_TAP_DEV;
                        name = "tap%d";
                } else
-                       goto failed;
+                       return -EINVAL;
 
                if (*ifr->ifr_name)
                        name = ifr->ifr_name;