The patch titled misc/isl29020: signedness bug in als_sensing_range_store() has been added to the -mm tree. Its filename is misc-isl29020-signedness-bug-in-als_sensing_range_store.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: misc/isl29020: signedness bug in als_sensing_range_store() From: Dan Carpenter <error27@xxxxxxxxx> "ret_val" is supposed to be signed here or the error handling breaks. Also we should check the return value from i2c_smbus_read_byte_data(). Signed-off-by: Dan Carpenter <error27@xxxxxxxxx> Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/misc/isl29020.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN drivers/misc/isl29020.c~misc-isl29020-signedness-bug-in-als_sensing_range_store drivers/misc/isl29020.c --- a/drivers/misc/isl29020.c~misc-isl29020-signedness-bug-in-als_sensing_range_store +++ a/drivers/misc/isl29020.c @@ -87,7 +87,7 @@ static ssize_t als_sensing_range_store(s struct device_attribute *attr, const char *buf, size_t count) { struct i2c_client *client = to_i2c_client(dev); - unsigned int ret_val; + int ret_val; unsigned long val; if (strict_strtoul(buf, 10, &val)) @@ -106,6 +106,8 @@ static ssize_t als_sensing_range_store(s val = 4; ret_val = i2c_smbus_read_byte_data(client, 0x00); + if (ret_val < 0) + return ret_val; ret_val &= 0xFC; /*reset the bit before setting them */ ret_val |= val - 1; _ Patches currently in -mm which might be from error27@xxxxxxxxx are origin.patch rapidio-use-resource_size.patch misc-isl29020-signedness-bug-in-als_sensing_range_store.patch linux-next.patch memcg-null-dereference-on-allocation-failure.patch drivers-misc-bh1770glcc-error-handling-in-bh1770_power_state_store.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html