summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-10-11 17:11:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-06 12:43:21 +0100
commitd7030f05a84cf6ce9587dce5fab9774666597cd5 (patch)
treed1632746120e960d3507be7af65b98016a427403
parent4df728651b8a99693c69962d8e5a5b9e5a3bbcc7 (diff)
downloadlinux-stable-d7030f05a84cf6ce9587dce5fab9774666597cd5.tar.gz
linux-stable-d7030f05a84cf6ce9587dce5fab9774666597cd5.tar.bz2
linux-stable-d7030f05a84cf6ce9587dce5fab9774666597cd5.zip
USB: legousbtower: fix a signedness bug in tower_probe()
[ Upstream commit fd47a417e75e2506eb3672ae569b1c87e3774155 ] The problem is that sizeof() is unsigned long so negative error codes are type promoted to high positive values and the condition becomes false. Fixes: 1d427be4a39d ("USB: legousbtower: fix slab info leak at probe") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20191011141115.GA4521@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/usb/misc/legousbtower.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 378a565ec989..a1ed6be87471 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -881,7 +881,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
get_version_reply,
sizeof(*get_version_reply),
1000);
- if (result < sizeof(*get_version_reply)) {
+ if (result != sizeof(*get_version_reply)) {
if (result >= 0)
result = -EIO;
dev_err(idev, "get version request failed: %d\n", result);