From: Javier Martinez Canillas Date: Mon, 20 Oct 2014 14:47:48 +0000 (+0200) Subject: regulator: of: Decrement refcount for suspend state nodes X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=4eafec83aa9ea8eb21bd5c1c980debc623eea164;p=openwrt%2Fstaging%2Fblogic.git regulator: of: Decrement refcount for suspend state nodes of_get_regulation_constraints() calls of_get_child_by_name() to find the regulator-state-{mem,disk} child nodes for each regulator. This function increments the device node reference counter but this is not decremented once the function is done using the node. Fix that by calling of_node_put() after finishing using the device node. Signed-off-by: Javier Martinez Canillas Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index b375ffe40df1..f0d19fc9d5d5 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -107,6 +107,7 @@ static void of_get_regulation_constraints(struct device_node *np, "regulator-off-in-suspend")) suspend_state->disabled = true; + of_node_put(suspend_np); suspend_state = NULL; suspend_np = NULL; }