[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190410182351.18352-1-colin.king@canonical.com>
Date: Wed, 10 Apr 2019 19:23:51 +0100
From: Colin King <colin.king@...onical.com>
To: Jonathan Cameron <jic23@...nel.org>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
Paresh Chaudhary <paresh.chaudhary@...kwellcollins.com>,
linux-iio@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] iio: temperature: max31856: fix uninitialized error return
From: Colin Ian King <colin.king@...onical.com>
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@...onical.com>
---
drivers/iio/temperature/max31856.c | 3 +++
1 file changed, 3 insertions(+)
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;
--
2.20.1
Powered by blists - more mailing lists