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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1480062577-11505-1-git-send-email-xuejiancheng@hisilicon.com>
Date:   Fri, 25 Nov 2016 16:29:37 +0800
From:   Jiancheng Xue <xuejiancheng@...ilicon.com>
To:     <p.zabel@...gutronix.de>
CC:     <linux-kernel@...r.kernel.org>, <afd@...com>, <s-anna@...com>,
        <yanhaifeng@...ilicon.com>, <zhangfei.gao@...il.com>,
        <xuejiancheng@...ilicon.com>
Subject: [PATCH] reset: ti_syscon: fix a ti_syscon_reset_status issue

If STATUS_SET is not set, ti_syscon_reset_status always returned 0
no matter the status_bit is set or not.

Signed-off-by: Jiancheng Xue <xuejiancheng@...ilicon.com>
---
 drivers/reset/reset-ti-syscon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 drivers/reset/reset-ti-syscon.c

diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c
old mode 100644
new mode 100755
index 47f0ffd..82769ff
--- a/drivers/reset/reset-ti-syscon.c
+++ b/drivers/reset/reset-ti-syscon.c
@@ -154,8 +154,8 @@ static int ti_syscon_reset_status(struct reset_controller_dev *rcdev,
 	if (ret)
 		return ret;
 
-	return (reset_state & BIT(control->status_bit)) &&
-			(control->flags & STATUS_SET);
+	ret = (reset_state & BIT(control->status_bit)) ? 1 : 0;
+	return (control->flags & STATUS_SET) ? ret : (!ret);
 }
 
 static struct reset_control_ops ti_syscon_reset_ops = {
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ