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


Groups > linux.kernel > #1394160

[PATCH] reset: allow to pass NULL pointer to reset_control_put()

From Masahiro Yamada <yamada.masahiro@socionext.com>
Newsgroups linux.kernel
Subject [PATCH] reset: allow to pass NULL pointer to reset_control_put()
Date 2016-05-04 13:20 +0200
Message-ID <rv30v-2OD-29@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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@socionext.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

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


Thread

[PATCH] reset: allow to pass NULL pointer to reset_control_put() Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-05-04 13:20 +0200
  Re: [PATCH] reset: allow to pass NULL pointer to reset_control_put() Arnd Bergmann <arnd@arndb.de> - 2016-05-04 13:30 +0200
    Re: [PATCH] reset: allow to pass NULL pointer to reset_control_put() Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-05-04 13:40 +0200
      Re: [PATCH] reset: allow to pass NULL pointer to reset_control_put() Philipp Zabel <p.zabel@pengutronix.de> - 2016-05-04 14:40 +0200
        Re: [PATCH] reset: allow to pass NULL pointer to reset_control_put() Arnd Bergmann <arnd@arndb.de> - 2016-05-04 14:50 +0200
      Re: [PATCH] reset: allow to pass NULL pointer to reset_control_put() Arnd Bergmann <arnd@arndb.de> - 2016-05-04 14:40 +0200

csiph-web