Skip to contentSkip to conversation

x25_asy: Fix ref count rule violation

PATCH New Alan Cox 1 participant 1 message Feb 8, 2008 Network drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 x25_asy: Fix ref count rule violation

x25_asy does not take an ldisc reference before calling the flush method. Fix it to use the helper function we provide.

drivers/net/wan/x25_asy.c +2 -3
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-mm1/drivers/net/wan/x25_asy.c linux-2.6.24-mm1/drivers/net/wan/x25_asy.c
@@ -554,6 +554,7 @@
 static int x25_asy_open_tty(struct tty_struct *tty)
 {
 	struct x25_asy *sl = (struct x25_asy *) tty->disc_data;
+	struct tty_ldisc *ld;
 	int err;
 
 	/* First make sure we're not already connected. */
@@ -572,9 +573,7 @@
 	if (tty->driver->flush_buffer)  {
 		tty->driver->flush_buffer(tty);
 	}
-	if (tty->ldisc.flush_buffer)  {
-		tty->ldisc.flush_buffer(tty);
-	}
+	tty_ldisc_flush(tty);
 
 	/* Restore default settings */
 	sl->dev->type = ARPHRD_X25;