浏览代码

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 <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Javier Martinez Canillas 10 年之前
父节点
当前提交
4eafec83aa
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/regulator/of_regulator.c

+ 1 - 0
drivers/regulator/of_regulator.c

@@ -107,6 +107,7 @@ static void of_get_regulation_constraints(struct device_node *np,
 					"regulator-off-in-suspend"))
 					"regulator-off-in-suspend"))
 			suspend_state->disabled = true;
 			suspend_state->disabled = true;
 
 
+		of_node_put(suspend_np);
 		suspend_state = NULL;
 		suspend_state = NULL;
 		suspend_np = NULL;
 		suspend_np = NULL;
 	}
 	}