USB: serial: mos7720: fix control-message error handling
commit9553708eb98dd81357eb9be51b6317387d2e7ac4
authorJohan Hovold <johan@kernel.org>
Thu, 12 Jan 2017 13:56:17 +0000 (12 14:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Oct 2017 08:26:06 +0000 (8 10:26 +0200)
treec38221ddb6566dab3e7eefde68c8f9b42780868e
parent09831a9577669fa16f4369a934e88d8ff644cfe0
USB: serial: mos7720: fix control-message error handling

[ Upstream commit 0d130367abf582e7cbf60075c2a7ab53817b1d14 ]

Make sure to log an error on short transfers when reading a device
register.

Also clear the provided buffer (which if often an uninitialised
automatic variable) on errors as the driver currently does not bother to
check for errors.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/mos7720.c