OSDN Git Service

USB: serial: io_edgeport: handle unbound ports on URB completion
authorJohan Hovold <johan@kernel.org>
Fri, 17 Jan 2020 09:50:23 +0000 (10:50 +0100)
committerJohan Hovold <johan@kernel.org>
Fri, 17 Jan 2020 15:22:57 +0000 (16:22 +0100)
commite37d1aeda737a20b1846a91a3da3f8b0f00cf690
treec9f70bd8160ecfa8c87fac055c515e81869f3ea4
parent4d5ef53f75c22d28f490bcc5c771fcc610a9afa4
USB: serial: io_edgeport: handle unbound ports on URB completion

Check for NULL port data in the shared interrupt and bulk completion
callbacks to avoid dereferencing a NULL pointer in case a device sends
data for a port device which isn't bound to a driver (e.g. due to a
malicious device having unexpected endpoints or after an allocation
failure on port probe).

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/io_edgeport.c