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.35.12~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=decdbcebb0bbb9b05858086131afc69b8a8da01e;p=thirdparty%2Fkernel%2Fstable.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 Signed-off-by: Andi Kleen --- diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 96500e90de3c7..3db3eaa11c1a7 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) if (!ACM_READY(acm)) return; tty = tty_port_tty_get(&acm->port); + if (!tty) + return; tty_wakeup(tty); tty_kref_put(tty); }