iio: cros_ec_sensors_core: fix unsigned compared less than zero on status
authorColin Ian King <colin.king@canonical.com>
Wed, 9 Nov 2016 23:12:31 +0000 (23:12 +0000)
committerJonathan Cameron <jic23@kernel.org>
Sat, 12 Nov 2016 14:38:38 +0000 (14:38 +0000)
commit6c02e33facff34b95b6d67a182b9a0a0b51fabf8
treeac540785f828d3e2b3d6cc7b5d57f319b15284ff
parent0d8391f3d60f0b544951b4014f433b4c068da293
iio: cros_ec_sensors_core: fix unsigned compared less than zero on status

status is a u8 hence the check if status is less than zero has no effect.
Fix this by replacing status with int ret so the less than zero compare
will correctly detect errors.

Issue found with static analysis with CoverityScan, CID 1375919

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Fixes: 974e6f02e27e ("iio: cros_ec_sensors_core: Add common functions for the ChromeOS EC Sensor Hub")
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c