USB: cdc-acm: fix potential null-pointer dereference
authorJohan Hovold <jhovold@gmail.com>
Tue, 22 Mar 2011 10:12:10 +0000 (11:12 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Mar 2011 20:21:59 +0000 (13:21 -0700)
Must check return value of tty_port_tty_get.

Cc: stable <stable@kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/cdc-acm.c

index 00d809d..1756371 100644 (file)
@@ -533,6 +533,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);
 }