]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: serial: ir-usb: add missing endpoint sanity check
authorJohan Hovold <johan@kernel.org>
Wed, 22 Jan 2020 10:15:26 +0000 (11:15 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 22 May 2020 20:19:31 +0000 (21:19 +0100)
commit4b9dcdf2264b073cacef03f6ab4e3d5ca817bbb1
tree4a3cf39f17b8aae43899f2a936193ded9347b0df
parent94c3d6738673cf797e0aeda359c90101f2ad657f
USB: serial: ir-usb: add missing endpoint sanity check

commit 2988a8ae7476fe9535ab620320790d1714bdad1d upstream.

Add missing endpoint sanity check to avoid dereferencing a NULL-pointer
on open() in case a device lacks a bulk-out endpoint.

Note that prior to commit f4a4cbb2047e ("USB: ir-usb: reimplement using
generic framework") the oops would instead happen on open() if the
device lacked a bulk-in endpoint and on write() if it lacked a bulk-out
endpoint.

Fixes: f4a4cbb2047e ("USB: ir-usb: reimplement using generic framework")
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/ir-usb.c