Nick Dyer
68807a0c20
Input: atmel_mxt_ts - fix invalid return from mxt_get_bootloader_version
The patch e57a66aa85: "Input: atmel_mxt_ts - read and report
bootloader version" from May 18, 2014, leads to the following static
checker warning:
drivers/input/touchscreen/atmel_mxt_ts.c:437 mxt_get_bootloader_version()
warn: signedness bug returning '(-5)'
drivers/input/touchscreen/atmel_mxt_ts.c
429 static u8 mxt_get_bootloader_version(struct mxt_data *data, u8 val)
430 {
431 struct device *dev = &data->client->dev;
432 u8 buf[3];
433
434 if (val & MXT_BOOT_EXTENDED_ID) {
435 if (mxt_bootloader_read(data, &buf[0], 3) != 0) {
436 dev_err(dev, "%s: i2c failure\n", __func__);
437 return -EIO;
^^^^
This gets truncated into a number from 0-255 and anyway the caller
doesn't check for errors.
(reported by Dan Carpenter)
Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-06-07 23:20:24 -07:00
..
2014-01-06 23:23:57 -08:00
2014-01-23 08:10:44 -08:00
2014-05-29 00:33:32 -07:00
2014-06-07 23:20:24 -07:00
2014-06-07 23:20:23 -07:00
2014-05-14 16:49:19 -07:00
2014-05-29 00:09:16 -07:00
2014-06-07 23:20:24 -07:00
2012-08-21 22:29:49 -07:00
2014-05-14 16:49:19 -07:00
2012-08-21 22:29:49 -07:00
2012-08-21 22:29:49 -07:00
2012-02-20 12:48:47 -08:00
2012-02-20 12:48:47 -08:00
2013-04-07 21:02:32 -07:00
2014-05-14 16:40:04 -07:00
2014-01-23 08:10:44 -08:00
2012-10-22 08:50:37 +03:00
2013-10-31 08:46:07 -07:00
2012-05-10 22:38:47 -07:00
2013-04-19 00:31:13 +02:00
2014-03-29 14:44:23 -07:00
2014-02-19 14:58:17 +01:00