diff options
author | Lee Jones <lee.jones@linaro.org> | 2014-08-13 11:27:34 +0100 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-09-26 08:15:27 +0100 |
commit | 374de1642ee4322cc4d6aa1d2679378b8547c368 (patch) | |
tree | ca61cf9f4f36660b079adf7713037f0c80dc38d1 | |
parent | 0608bab8c7ceabd363901376d3693e8f45371768 (diff) | |
download | blackbird-op-linux-374de1642ee4322cc4d6aa1d2679378b8547c368.tar.gz blackbird-op-linux-374de1642ee4322cc4d6aa1d2679378b8547c368.zip |
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>
-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, if (of_pdata) pdata = of_pdata; - if (pdata) + if (pdata) { err = st_sensors_set_drdy_int_pin(indio_dev, pdata); + if (err < 0) + return err; + } err = st_sensors_set_enable(indio_dev, false); if (err < 0) |