reset: core: fix reset_control_put
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 1 Feb 2017 07:05:22 +0000 (08:05 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Wed, 1 Feb 2017 15:04:25 +0000 (16:04 +0100)
Commit "reset: make optional functions really optional" missed to
adjust one check in reset_control_put, causing a NULL pointer
access for optional resets.

Fixes: bb475230b8e5 "reset: make optional functions really optional"
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/core.c

index c79cce3..71ccf28 100644 (file)
@@ -392,7 +392,7 @@ EXPORT_SYMBOL_GPL(__of_reset_control_get);
 
 void reset_control_put(struct reset_control *rstc)
 {
-       if (IS_ERR(rstc))
+       if (IS_ERR_OR_NULL(rstc))
                return;
 
        mutex_lock(&reset_list_mutex);