Skip to content

Commit 0438ee7

Browse files
author
Jiri Kosina
committed
HID: cp2112: fix incorrect error propagation in cp2112_xfer()
Both cp2112_read_req() and cp2112_write_req() are returning negative value in cases of error, but cp2112_xfer() is storing the return value into unsigned size_t-typed 'count'. Fix this by making 'count' signed type. Reported-by: fengguang.wu@intel.com Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent a47dc4d commit 0438ee7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/hid/hid-cp2112.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
428428
struct hid_device *hdev = dev->hdev;
429429
u8 buf[64];
430430
__be16 word;
431-
size_t count;
431+
ssize_t count;
432432
size_t read_length = 0;
433433
unsigned int retries;
434434
int ret;

0 commit comments

Comments
 (0)