lkml.org 
[lkml]   [2016]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] reset: allow to pass NULL pointer to reset_control_put()
Date
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
\
 
 \ /
  Last update: 2016-05-04 13:21    [W:0.059 / U:1.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site