USB: CDC ACM: Fix NULL pointer dereference
authorSven Schnelle <svens@stackframe.org>
Fri, 17 Aug 2012 19:43:43 +0000 (21:43 +0200)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 10 Feb 2014 21:11:22 +0000 (16:11 -0500)
commit49bfc0de47432b653b20413fb4241586bcbf294d
treee4f3a9d0b3582adccbc95dd5d955e08927f3e057
parent8c59f0a9b89d27df04c174f589a0e85043fea642
USB: CDC ACM: Fix NULL pointer dereference

commit 99f347caa4568cb803862730b3b1f1942639523f upstream.

If a device specifies zero endpoints in its interface descriptor,
the kernel oopses in acm_probe(). Even though that's clearly an
invalid descriptor, we should test wether we have all endpoints.
This is especially bad as this oops can be triggered by just
plugging a USB device in.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/usb/class/cdc-acm.c