]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
USB: serial: fix potential NULL-dereference at probe
authorJohan Hovold <johan@kernel.org>
Fri, 21 Oct 2016 10:56:27 +0000 (12:56 +0200)
committerLuis Henriques <luis.henriques@canonical.com>
Tue, 6 Dec 2016 16:51:40 +0000 (16:51 +0000)
commitabb237a0d68afb04f42820427d1ab9f5832c482f
tree4de5fb80c2e13978f27608b80448ab4f99f2b124
parent0dbd2050197ea4dd59f8957b72981cb7d2cfab1c
USB: serial: fix potential NULL-dereference at probe

BugLink: http://bugs.launchpad.net/bugs/1642572
commit 126d26f66d9890a69158812a6caa248c05359daa upstream.

Make sure we have at least one port before attempting to register a
console.

Currently, at least one driver binds to a "dummy" interface and requests
zero ports for it. Should such an interface also lack endpoints, we get
a NULL-deref during probe.

Fixes: e5b1e2062e05 ("USB: serial: make minor allocation dynamic")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/usb/serial/usb-serial.c