Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1461853

[PATCH 3.16 230/305] staging: iio: accel: fix error check

From Ben Hutchings <ben@decadent.org.uk>
Newsgroups linux.kernel
Subject [PATCH 3.16 230/305] staging: iio: accel: fix error check
Date 2016-08-14 13:10 +0200
Message-ID <s61sL-7d0-65@gated-at.bofh.it> (permalink)
References <s5LnX-4sk-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.16.37-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Luis de Bethencourt <luisbg@osg.samsung.com>

commit ef3149eb3ddb7f9125e11c90f8330e371b55cffd upstream.

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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/staging/iio/accel/sca3000_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -619,7 +619,7 @@ static ssize_t sca3000_read_frequency(st
 		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)

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 3.16 230/305] staging: iio: accel: fix error check Ben Hutchings <ben@decadent.org.uk> - 2016-08-14 13:10 +0200

csiph-web