Skip to content

Commit 3b780be

Browse files
committed
x25_asy: Free x25_asy on x25_asy_open() failure.
Based upon a report by Dmitry Vyukov. Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 00ae40e commit 3b780be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/wan/x25_asy.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,10 @@ static int x25_asy_open_tty(struct tty_struct *tty)
571571

572572
/* Perform the low-level X.25 async init */
573573
err = x25_asy_open(sl->dev);
574-
if (err)
574+
if (err) {
575+
x25_asy_free(sl);
575576
return err;
577+
}
576578
/* Done. We have linked the TTY line to a channel. */
577579
return 0;
578580
}

0 commit comments

Comments
 (0)