Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11b0cc3a authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

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.

Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4600ecfc
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -554,6 +554,7 @@ static void x25_asy_receive_buf(struct tty_struct *tty, const unsigned char *cp,
static int x25_asy_open_tty(struct tty_struct *tty)
static int x25_asy_open_tty(struct tty_struct *tty)
{
{
	struct x25_asy *sl = (struct x25_asy *) tty->disc_data;
	struct x25_asy *sl = (struct x25_asy *) tty->disc_data;
	struct tty_ldisc *ld;
	int err;
	int err;


	/* First make sure we're not already connected. */
	/* First make sure we're not already connected. */
@@ -572,9 +573,7 @@ static int x25_asy_open_tty(struct tty_struct *tty)
	if (tty->driver->flush_buffer)  {
	if (tty->driver->flush_buffer)  {
		tty->driver->flush_buffer(tty);
		tty->driver->flush_buffer(tty);
	}
	}
	if (tty->ldisc.flush_buffer)  {
	tty_ldisc_flush(tty);
		tty->ldisc.flush_buffer(tty);
	}


	/* Restore default settings */
	/* Restore default settings */
	sl->dev->type = ARPHRD_X25;
	sl->dev->type = ARPHRD_X25;