USB: serial: ftdi_sio: fix latency-timer error handling
authorJohan Hovold <johan@kernel.org>
Thu, 12 Jan 2017 13:56:12 +0000 (14:56 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 5 Jun 2017 20:13:42 +0000 (21:13 +0100)
commit6aea78a67e8b1c33a2d21c61ac8122472c2cfaa8
tree901b0c357552ddff99fb834033a4c875aec5c963
parentc874cde1a49694c863acf7921da32769187f4fc9
USB: serial: ftdi_sio: fix latency-timer error handling

commit e3e574ad85a208cb179f33720bb5f12b453de33c upstream.

Make sure to detect short responses when reading the latency timer to
avoid using stale buffer data.

Note that no heap data would currently leak through sysfs as
ASYNC_LOW_LATENCY is set by default.

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/ftdi_sio.c