summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorLuis de Bethencourt <luisbg@osg.samsung.com>2016-06-22 20:43:31 +0100
committerJonathan Cameron <jic23@kernel.org>2016-06-27 20:59:10 +0100
commitaea7b1dc2bb7405f2d7827b202788fbee3912c1a (patch)
tree337e0418da36a750e180ae29a0965428dabf4429 /drivers/staging/iio
parent7feae871b263b509625b3bf946d4f1d72bb77c70 (diff)
downloadblackbird-op-linux-aea7b1dc2bb7405f2d7827b202788fbee3912c1a.tar.gz
blackbird-op-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.c2
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
OpenPOWER on IntegriCloud