]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
USB: lvtest: fix NULL-deref at probe
authorJohan Hovold <johan@kernel.org>
Mon, 13 Mar 2017 12:47:49 +0000 (13:47 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Thu, 30 Mar 2017 12:35:45 +0000 (06:35 -0600)
commitec38e37a9ee2e00b2ef35e2fbaf606b58303d21c
tree735bb2ad7698764725daf5d2ae51bab04f1b7191
parentc637ee67b7d1e6722704a30dd8fe71021f9b163e
USB: lvtest: fix NULL-deref at probe

BugLink: http://bugs.launchpad.net/bugs/1677589
commit 1dc56c52d2484be09c7398a5207d6b11a4256be9 upstream.

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer should the probed device lack endpoints.

Note that this driver does not bind to any devices by default.

Fixes: ce21bfe603b3 ("USB: Add LVS Test device driver")
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/usb/misc/lvstest.c