aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-10-11 17:11:15 +0300
committerPaul Gortmaker <paul.gortmaker@windriver.com>2019-11-09 19:33:57 -0500
commit0ba545e8fda841bf13585f0d78f6293d7642ed37 (patch)
tree3870f2e8036c8d19da3c2492a43d30c9bb33f95f
parent4c6f2341bb9f3a194999e5bcab4554bf77c236de (diff)
downloadlinux-yocto-0ba545e8fda841bf13585f0d78f6293d7642ed37.tar.gz
linux-yocto-0ba545e8fda841bf13585f0d78f6293d7642ed37.tar.bz2
linux-yocto-0ba545e8fda841bf13585f0d78f6293d7642ed37.zip
USB: legousbtower: fix a signedness bug in tower_probe()
commit fd47a417e75e2506eb3672ae569b1c87e3774155 upstream. 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: Paul Gortmaker <paul.gortmaker@windriver.com>
-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 9d4c52a7ebe0..9bd240df8f4c 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);