Преглед изворни кода

Hold RTNL while calling dev_close()

dev_close() must be called holding the RTNL.  Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Ben Hutchings пре 17 година
родитељ
комит
3e3cda96d0
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      drivers/net/wan/x25_asy.c

+ 3 - 0
drivers/net/wan/x25_asy.c

@@ -32,6 +32,7 @@
 #include <linux/x25.h>
 #include <linux/x25.h>
 #include <linux/lapb.h>
 #include <linux/lapb.h>
 #include <linux/init.h>
 #include <linux/init.h>
+#include <linux/rtnetlink.h>
 #include "x25_asy.h"
 #include "x25_asy.h"
 
 
 #include <net/x25device.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)
 	if (!sl || sl->magic != X25_ASY_MAGIC)
 		return;
 		return;
 
 
+	rtnl_lock();
 	if (sl->dev->flags & IFF_UP)
 	if (sl->dev->flags & IFF_UP)
 		dev_close(sl->dev);
 		dev_close(sl->dev);
+	rtnl_unlock();
 
 
 	tty->disc_data = NULL;
 	tty->disc_data = NULL;
 	sl->tty = NULL;
 	sl->tty = NULL;