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]
Date:	Wed,  4 May 2016 20:17:51 +0900
From:	Masahiro Yamada <yamada.masahiro@...ionext.com>
To:	linux-kernel@...r.kernel.org,
	Philipp Zabel <p.zabel@...gutronix.de>
Cc:	Arnd Bergmann <arnd@...db.de>,
	Masahiro Yamada <yamada.masahiro@...ionext.com>
Subject: [PATCH] reset: allow to pass NULL pointer to reset_control_put()

Currently, reset_control_put() just returns for error pointer,
but not for NULL pointer.  This is not reasonable.

Passing NULL pointer should be allowed as well to make failure path
handling easier.

Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
---

 drivers/reset/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index 181b05d..7bb16d1 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -288,7 +288,7 @@ EXPORT_SYMBOL_GPL(reset_control_get);
 
 void reset_control_put(struct reset_control *rstc)
 {
-	if (IS_ERR(rstc))
+	if (IS_ERR_OR_NULL(rstc))
 		return;
 
 	module_put(rstc->rcdev->owner);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ