]> git.itanic.dy.fi Git - linux-stable/commitdiff
USB: cdc-acm: fix potential null-pointer dereference
authorJohan Hovold <jhovold@gmail.com>
Tue, 22 Mar 2011 10:12:10 +0000 (11:12 +0100)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 26 Jun 2011 16:47:12 +0000 (12:47 -0400)
commit 15e5bee33ffc11d0e5c6f819a65e7881c5c407be upstream.

Must check return value of tty_port_tty_get.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/usb/class/cdc-acm.c

index 073a9ef9fe605059a5d6b846a1a9b7fafec6cfe8..af5ed89ca98cc97e8926b5bfea6a94fd3ebbb05f 100644 (file)
@@ -534,6 +534,8 @@ static void acm_softint(struct work_struct *work)
        if (!ACM_READY(acm))
                return;
        tty = tty_port_tty_get(&acm->port);
+       if (!tty)
+               return;
        tty_wakeup(tty);
        tty_kref_put(tty);
 }