diff options
author | Lee Jones <lee.jones@linaro.org> | 2014-08-28 09:14:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-08-30 05:49:22 -0400 |
commit | 3c8bf223469b4db4d63e1dd8bdbde5ffb32d0cba (patch) | |
tree | a768a5f30cda5ebb8356207e5c8808fa4747ca48 /drivers/iio | |
parent | 3068ab202e637d5e46831a2276c3849d97655192 (diff) |
iio: sensors-core: st: Check st_sensors_set_drdy_int_pin()'s return value
Value from st_sensors_set_drdy_int_pin() is assigned to err here,
but that stored value is not used before it is overwritten. To fix
this we're enforcing a check on st_sensors_set_drdy_int_pin()'s
return value and if it's an error, we're returning right away.
Cc: jic23@kernel.org
Cc: linux-iio@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/common/st_sensors/st_sensors_core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c index 8a4ec00a91a0..24cfe4e044f9 100644 --- a/drivers/iio/common/st_sensors/st_sensors_core.c +++ b/drivers/iio/common/st_sensors/st_sensors_core.c | |||
@@ -306,8 +306,11 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev, | |||
306 | if (of_pdata) | 306 | if (of_pdata) |
307 | pdata = of_pdata; | 307 | pdata = of_pdata; |
308 | 308 | ||
309 | if (pdata) | 309 | if (pdata) { |
310 | err = st_sensors_set_drdy_int_pin(indio_dev, pdata); | 310 | err = st_sensors_set_drdy_int_pin(indio_dev, pdata); |
311 | if (err < 0) | ||
312 | return err; | ||
313 | } | ||
311 | 314 | ||
312 | err = st_sensors_set_enable(indio_dev, false); | 315 | err = st_sensors_set_enable(indio_dev, false); |
313 | if (err < 0) | 316 | if (err < 0) |