[PATCH] [237/275] USB: cdc-acm: fix potential null-pointer dereference

From: Andi Kleen
Date: Wed Mar 30 2011 - 17:18:46 EST


2.6.35-longterm review patch. If anyone has any objections, please let me know.

------------------
From: Johan Hovold <jhovold@xxxxxxxxx>

commit 15e5bee33ffc11d0e5c6f819a65e7881c5c407be upstream.

Must check return value of tty_port_tty_get.

Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>

---
drivers/usb/class/cdc-acm.c | 2 ++
1 file changed, 2 insertions(+)

Index: linux-2.6.35.y/drivers/usb/class/cdc-acm.c
===================================================================
--- linux-2.6.35.y.orig/drivers/usb/class/cdc-acm.c 2011-03-29 23:03:03.135219948 -0700
+++ linux-2.6.35.y/drivers/usb/class/cdc-acm.c 2011-03-29 23:53:54.272148988 -0700
@@ -533,6 +533,8 @@
if (!ACM_READY(acm))
return;
tty = tty_port_tty_get(&acm->port);
+ if (!tty)
+ return;
tty_wakeup(tty);
tty_kref_put(tty);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/