]> git.karo-electronics.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)
committerAK <andi@firstfloor.org>
Thu, 31 Mar 2011 18:58:47 +0000 (11:58 -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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/usb/class/cdc-acm.c

index 96500e90de3c729d8a71de54a067b606144b3908..3db3eaa11c1a7ff89bdb9ec3053b720d03dff7bc 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);
 }