From: Johan Hovold Date: Tue, 22 Mar 2011 10:12:10 +0000 (+0100) Subject: USB: cdc-acm: fix potential null-pointer dereference X-Git-Tag: v2.6.32.36~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=84241926c6de00e379993d71d7790f3863aa3a71;p=karo-tx-linux.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index cda15ef632c5..7512dfdb7e0f 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); }