|
@@ -946,8 +946,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
|
|
char *name;
|
|
char *name;
|
|
unsigned long flags = 0;
|
|
unsigned long flags = 0;
|
|
|
|
|
|
- err = -EINVAL;
|
|
|
|
-
|
|
|
|
if (!capable(CAP_NET_ADMIN))
|
|
if (!capable(CAP_NET_ADMIN))
|
|
return -EPERM;
|
|
return -EPERM;
|
|
err = security_tun_dev_create();
|
|
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;
|
|
flags |= TUN_TAP_DEV;
|
|
name = "tap%d";
|
|
name = "tap%d";
|
|
} else
|
|
} else
|
|
- goto failed;
|
|
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
|
if (*ifr->ifr_name)
|
|
if (*ifr->ifr_name)
|
|
name = ifr->ifr_name;
|
|
name = ifr->ifr_name;
|