summaryrefslogtreecommitdiffstats
path: root/drivers/iio/temperature/max31856.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-04-10 20:23:51 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2019-04-14 14:50:09 +0200
commit8e4fefec0174b43fd149dee159131c88cb623664 (patch)
tree304d64578cc742e8438782a6a313172cd55f5e8f /drivers/iio/temperature/max31856.c
parentiio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyr... (diff)
downloadlinux-8e4fefec0174b43fd149dee159131c88cb623664.tar.xz
linux-8e4fefec0174b43fd149dee159131c88cb623664.zip
iio: temperature: max31856: fix uninitialized error return
Currently if mask is neither CHAN_INFO_RAW or CHAN_INFO_SCALE then then an uninitialized error return 'ret' is returned. Fix this by adding a default case that ensures -EINVAL is returned for this specific case. Addresses-Coverity: ("Uninitialized scalar variable") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/temperature/max31856.c')
-rw-r--r--drivers/iio/temperature/max31856.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iio/temperature/max31856.c b/drivers/iio/temperature/max31856.c
index 6b67d6b95cf9..f184ba5601d9 100644
--- a/drivers/iio/temperature/max31856.c
+++ b/drivers/iio/temperature/max31856.c
@@ -210,6 +210,9 @@ static int max31856_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT_PLUS_MICRO;
}
break;
+ default:
+ ret = -EINVAL;
+ break;
}
return ret;