Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155011
b: refs/heads/master
c: d23e436
h: refs/heads/master
i:
  155009: d4f4190
  155007: a08d3f9
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jul 6, 2009
1 parent 7150d6c commit 678f0be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c001c213b109c8baeeb6d012b422bf059b18368f
refs/heads/master: d23e43658aed286b885d398ff0810f04f6aae97f
16 changes: 9 additions & 7 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,20 +1324,22 @@ static int tun_chr_close(struct inode *inode, struct file *file)
struct tun_file *tfile = file->private_data;
struct tun_struct *tun;


rtnl_lock();
tun = __tun_get(tfile);
if (tun) {
DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name);
struct net_device *dev = tun->dev;

DBG(KERN_INFO "%s: tun_chr_close\n", dev->name);

__tun_detach(tun);

/* If desireable, unregister the netdevice. */
if (!(tun->flags & TUN_PERSIST))
unregister_netdevice(tun->dev);

if (!(tun->flags & TUN_PERSIST)) {
rtnl_lock();
if (dev->reg_state == NETREG_REGISTERED)
unregister_netdevice(dev);
rtnl_unlock();
}
}
rtnl_unlock();

tun = tfile->tun;
if (tun)
Expand Down

0 comments on commit 678f0be

Please sign in to comment.