Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef3149eb authored by Luis de Bethencourt's avatar Luis de Bethencourt Committed by Jonathan Cameron
Browse files

staging: iio: accel: fix error check



sca3000_read_ctrl_reg() returns a negative number on failure, check for
this instead of zero.

Signed-off-by: default avatarLuis de Bethencourt <luisbg@osg.samsung.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent df013212
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)