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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170320104215.7627-1-p.zabel@pengutronix.de>
Date:   Mon, 20 Mar 2017 11:42:15 +0100
From:   Philipp Zabel <p.zabel@...gutronix.de>
To:     linux-kernel@...r.kernel.org
Cc:     Andrzej Hajda <a.hajda@...sung.com>,
        Jaehoon Chung <jh80.chung@...sung.com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Ramiro Oliveira <Ramiro.Oliveira@...opsys.com>
Subject: [PATCH] reset: fix optional reset_control_get stubs to return NULL

When RESET_CONTROLLER is not enabled, the optional reset_control_get
stubs should now also return NULL.

Fixes: bb475230b8e5 ("reset: make optional functions really optional")
Reported-by: Andrzej Hajda <a.hajda@...sung.com>
Cc: Ramiro Oliveira <Ramiro.Oliveira@...opsys.com>
Signed-off-by: Philipp Zabel <p.zabel@...gutronix.de>
---
 include/linux/reset.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/reset.h b/include/linux/reset.h
index 86b4ed75359e8..c905ff1c21ec6 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -74,14 +74,14 @@ static inline struct reset_control *__of_reset_control_get(
 					const char *id, int index, bool shared,
 					bool optional)
 {
-	return ERR_PTR(-ENOTSUPP);
+	return optional ? NULL : ERR_PTR(-ENOTSUPP);
 }
 
 static inline struct reset_control *__devm_reset_control_get(
 					struct device *dev, const char *id,
 					int index, bool shared, bool optional)
 {
-	return ERR_PTR(-ENOTSUPP);
+	return optional ? NULL : ERR_PTR(-ENOTSUPP);
 }
 
 #endif /* CONFIG_RESET_CONTROLLER */
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ