Skip to content

Commit

Permalink
staging: iio: accel: fix error check
Browse files Browse the repository at this point in the history
sca3000_read_ctrl_reg() returns a negative number on failure, check for
this instead of zero.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Luis de Bethencourt authored and Jonathan Cameron committed Jun 26, 2016
1 parent df01321 commit ef3149e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/accel/sca3000_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ static ssize_t sca3000_read_frequency(struct device *dev,
goto error_ret_mut;
ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL);
mutex_unlock(&st->lock);
if (ret)
if (ret < 0)
goto error_ret;
val = ret;
if (base_freq > 0)
Expand Down

0 comments on commit ef3149e

Please sign in to comment.