mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] reset: allow to pass NULL pointer to reset_control_put()
@ 2016-05-04 11:17 Masahiro Yamada
  2016-05-04 11:24 ` Arnd Bergmann
  0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2016-05-04 11:17 UTC (permalink / raw)
  To: linux-kernel, Philipp Zabel; +Cc: Arnd Bergmann, Masahiro Yamada

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-04 12:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-04 11:17 [PATCH] reset: allow to pass NULL pointer to reset_control_put() Masahiro Yamada
2016-05-04 11:24 ` Arnd Bergmann
2016-05-04 11:34   ` Masahiro Yamada
2016-05-04 12:34     ` Philipp Zabel
2016-05-04 12:47       ` Arnd Bergmann
2016-05-04 12:35     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®