USB: lvtest: return proper error code in probe
authorEvgeny Novikov <novikov@ispras.ru>
Wed, 5 Aug 2020 09:06:43 +0000 (12:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:21:20 +0000 (11:21 +0200)
commit8e9edff8ddc917eaa58112f1a305b4c1273582af
treedbbf282448622dc5abf3ba8e586c91ab44c31fbb
parent451bffa366f2cc0e5314807cb847f31c0226efed
USB: lvtest: return proper error code in probe

commit 531412492ce93ea29b9ca3b4eb5e3ed771f851dd upstream.

lvs_rh_probe() can return some nonnegative value from usb_control_msg()
when it is less than "USB_DT_HUB_NONVAR_SIZE + 2" that is considered as
a failure. Make lvs_rh_probe() return -EINVAL in this case.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200805090643.3432-1-novikov@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/lvstest.c