summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/quatech2.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-06-25 15:35:18 +0800
committerJohan Hovold <johan@kernel.org>2018-06-25 10:34:31 +0200
commit3391ca1dcd70a8e958984f7e95f242d36f0b9ab8 (patch)
tree46f126bb63af361216187d7b8540a7037adce9ce /drivers/usb/serial/quatech2.c
parent7daf201d7fe8334e2d2364d4e8ed3394ec9af819 (diff)
downloadlinux-stable-3391ca1dcd70a8e958984f7e95f242d36f0b9ab8.tar.gz
linux-stable-3391ca1dcd70a8e958984f7e95f242d36f0b9ab8.tar.bz2
linux-stable-3391ca1dcd70a8e958984f7e95f242d36f0b9ab8.zip
USB: serial: cast sizeof() to int when comparing with error code
Negative error code will be larger than sizeof(). Note that none of these bugs prevent errors from being detected, even if the ir-usb one would cause a less precise debug message to printed. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> [ johan: add comment about implications ] Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/quatech2.c')
-rw-r--r--drivers/usb/serial/quatech2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
index 958e12e1e7c7..ff2322ea5e14 100644
--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -194,7 +194,7 @@ static inline int qt2_getregister(struct usb_device *dev,
ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
QT_SET_GET_REGISTER, 0xc0, reg,
uart, data, sizeof(*data), QT2_USB_TIMEOUT);
- if (ret < sizeof(*data)) {
+ if (ret < (int)sizeof(*data)) {
if (ret >= 0)
ret = -EIO;
}