x25_asy: Free x25_asy on x25_asy_open() failure.
authorDavid S. Miller <davem@davemloft.net>
Wed, 13 Jan 2016 16:45:39 +0000 (11:45 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Jan 2016 16:45:39 +0000 (11:45 -0500)
Based upon a report by Dmitry Vyukov.

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/x25_asy.c

index cd39025d2abf5923f49e83adb08bb8de88373cb5..1bc5e93d2a342181503e85e2f2729d6e983dd31f 100644 (file)
@@ -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;
 }