lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1464728884-29686-1-git-send-email-luisbg@osg.samsung.com>
Date:	Tue, 31 May 2016 22:08:03 +0100
From:	Luis de Bethencourt <luisbg@....samsung.com>
To:	linux-kernel@...r.kernel.org
Cc:	gregkh@...uxfoundation.org, knaack.h@....de, lars@...afoo.de,
	jic23@...nel.org, ciorneiioana@...il.com,
	janani.rvchndrn@...il.com, afd@...com, linux-iio@...r.kernel.org,
	devel@...verdev.osuosl.org,
	Luis de Bethencourt <luisbg@....samsung.com>
Subject: [PATCH 1/2] 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: Luis de Bethencourt <luisbg@....samsung.com>
Reviewed-by: Andrew F. Davis <afd@...com>
Reviewed-by: Jonathan Cameron <jic23@...nel.org>
---

Patch corrected thanks to comments from Andrew F. Davis and Jonathan Cameron.
https://lkml.org/lkml/2016/5/31/862

Thanks,
Luis

 drivers/staging/iio/accel/sca3000_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
index a8f533a..ec12181 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -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)
-- 
2.5.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ