diff options
author | Luis de Bethencourt <luisbg@osg.samsung.com> | 2016-06-22 20:43:31 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-06-27 20:59:10 +0100 |
commit | aea7b1dc2bb7405f2d7827b202788fbee3912c1a (patch) | |
tree | 337e0418da36a750e180ae29a0965428dabf4429 /drivers/staging/iio | |
parent | 7feae871b263b509625b3bf946d4f1d72bb77c70 (diff) | |
download | linux-aea7b1dc2bb7405f2d7827b202788fbee3912c1a.tar.gz linux-aea7b1dc2bb7405f2d7827b202788fbee3912c1a.tar.bz2 linux-aea7b1dc2bb7405f2d7827b202788fbee3912c1a.zip |
staging: iio: accel: add error check
Go to error_ret if sca3000_read_ctrl_reg() failed.
Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/accel/sca3000_core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c index a8f533af9eca..53c5425d02b3 100644 --- a/drivers/staging/iio/accel/sca3000_core.c +++ b/drivers/staging/iio/accel/sca3000_core.c @@ -1046,6 +1046,8 @@ static int sca3000_clean_setup(struct sca3000_state *st) /* Disable ring buffer */ ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL); + if (ret < 0) + goto error_ret; ret = sca3000_write_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL, (ret & SCA3000_OUT_CTRL_PROT_MASK) | SCA3000_OUT_CTRL_BUF_X_EN |