aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2011-03-22 11:12:10 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-28 07:31:22 -0700
commit0530c26f6cd6991fe56e37101fb440d9953309af (patch)
tree3b442f680ca277afd5072d00a18bcc7601b97ad3
parente9f4fcfaa4de566650a8837ff0d722a1f6876417 (diff)
USB: cdc-acm: fix potential null-pointer dereference
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>
-rw-r--r--drivers/usb/class/cdc-acm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 2b26ff81b59..9872610de26 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -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);
}