]> git.kernelconcepts.de Git - karo-tx-linux.git/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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Mar 2011 18:30:48 +0000 (11:30 -0700)
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>
drivers/usb/class/cdc-acm.c

index cda15ef632c533102a7a0776d5a82b12b64c6cb9..7512dfdb7e0f80ef3988bca878a7b21dc2aa2b20 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);
 }