提交 3e3cda96 编写于 作者: B Ben Hutchings 提交者: Jeff Garzik

Hold RTNL while calling dev_close()

dev_close() must be called holding the RTNL.  Compile-tested only.
Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 c81ec80b
......@@ -32,6 +32,7 @@
#include <linux/x25.h>
#include <linux/lapb.h>
#include <linux/init.h>
#include <linux/rtnetlink.h>
#include "x25_asy.h"
#include <net/x25device.h>
......@@ -601,8 +602,10 @@ static void x25_asy_close_tty(struct tty_struct *tty)
if (!sl || sl->magic != X25_ASY_MAGIC)
return;
rtnl_lock();
if (sl->dev->flags & IFF_UP)
dev_close(sl->dev);
rtnl_unlock();
tty->disc_data = NULL;
sl->tty = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册