Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1093736b authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Linus Torvalds
Browse files

drivers/misc/apds9802als.c: fix signedness bug



i2c_smbus_read_byte_data() may return negative error code.  This is not
seen to als_sensing_range_store() as the result is stored in unsigned int.

Made it signed.

Signed-off-by: default avatarVasiliy Kulikov <segooon@gmail.com>
Cc: Hong Liu <hong.liu@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Anantha Narayanan <anantha.narayanan@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 90482e45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ static ssize_t als_sensing_range_store(struct device *dev,
{
	struct i2c_client *client = to_i2c_client(dev);
	struct als_data *data = i2c_get_clientdata(client);
	unsigned int ret_val;
	int ret_val;
	unsigned long val;

	if (strict_strtoul(buf, 10, &val))