]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/tun.c
bnx2x: move debugging code before the return
[karo-tx-linux.git] / drivers / net / tun.c
index fbd106edbe59bdcae871e29d6fd70c993634cdea..cf6da6efc71a6284a212594a8d7513817c503cc4 100644 (file)
@@ -491,6 +491,8 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
        err = -EINVAL;
        if (rcu_dereference_protected(tfile->tun, lockdep_rtnl_is_held()))
                goto out;
+       if (tfile->detached && tun != tfile->detached)
+               goto out;
 
        err = -EBUSY;
        if (!(tun->flags & TUN_TAP_MQ) && tun->numqueues == 1)