Skip to content

Commit

Permalink
x25_asy: Free x25_asy on x25_asy_open() failure.
Browse files Browse the repository at this point in the history
Based upon a report by Dmitry Vyukov.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jan 13, 2016
1 parent 00ae40e commit 3b780be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/wan/x25_asy.c
Original file line number Diff line number Diff line change
@@ -571,8 +571,10 @@ static int x25_asy_open_tty(struct tty_struct *tty)

/* Perform the low-level X.25 async init */
err = x25_asy_open(sl->dev);
if (err)
if (err) {
x25_asy_free(sl);
return err;
}
/* Done. We have linked the TTY line to a channel. */
return 0;
}

0 comments on commit 3b780be

Please sign in to comment.