diff options
author | Johan Hovold <jhovold@gmail.com> | 2011-03-22 06:12:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-23 16:21:59 -0400 |
commit | 15e5bee33ffc11d0e5c6f819a65e7881c5c407be (patch) | |
tree | 364c0fa67bc8684ee7d329762ef870738ec0f91a /drivers/usb/class/cdc-acm.c | |
parent | 23b80550e2aa61d0ba3af98b831b9195be0db9ee (diff) |
USB: cdc-acm: fix potential null-pointer dereference
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>
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 00d809dfe84d..175637148962 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -533,6 +533,8 @@ static void acm_softint(struct work_struct *work) | |||
533 | if (!ACM_READY(acm)) | 533 | if (!ACM_READY(acm)) |
534 | return; | 534 | return; |
535 | tty = tty_port_tty_get(&acm->port); | 535 | tty = tty_port_tty_get(&acm->port); |
536 | if (!tty) | ||
537 | return; | ||
536 | tty_wakeup(tty); | 538 | tty_wakeup(tty); |
537 | tty_kref_put(tty); | 539 | tty_kref_put(tty); |
538 | } | 540 | } |