aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-88pm860x.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-04-04 03:51:20 -0400
committerBryan Wu <cooloney@gmail.com>2014-05-08 02:28:08 -0400
commit1175d5bc7b490a5175c955b4e656f42577a43ecf (patch)
treefcc5dbd67343493161014d9aaa57a5afe30c357c /drivers/leds/leds-88pm860x.c
parent77dfa771677f0af57b4093c81c5fdbd1946e8bc9 (diff)
leds: 88pm860x: Fix missing refcount decrement for parent of_node
The driver obtained the reference to parent->of_node but immediately it was overwritten by reference to child node 'leds'. The of_node_put at the end of DT parsing function decremented only the child 'leds' so effectively the reference to parent of_node leaked. Getting reference to parent->of_node is not needed at all so get rid of it to fix the reference count. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/leds-88pm860x.c')
-rw-r--r--drivers/leds/leds-88pm860x.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/leds/leds-88pm860x.c b/drivers/leds/leds-88pm860x.c
index c3d58e6478ac..c2def5551ce1 100644
--- a/drivers/leds/leds-88pm860x.c
+++ b/drivers/leds/leds-88pm860x.c
@@ -130,10 +130,9 @@ static int pm860x_led_dt_init(struct platform_device *pdev,
130 struct device_node *nproot, *np; 130 struct device_node *nproot, *np;
131 int iset = 0; 131 int iset = 0;
132 132
133 nproot = of_node_get(pdev->dev.parent->of_node); 133 if (!pdev->dev.parent->of_node)
134 if (!nproot)
135 return -ENODEV; 134 return -ENODEV;
136 nproot = of_get_child_by_name(nproot, "leds"); 135 nproot = of_get_child_by_name(pdev->dev.parent->of_node, "leds");
137 if (!nproot) { 136 if (!nproot) {
138 dev_err(&pdev->dev, "failed to find leds node\n"); 137 dev_err(&pdev->dev, "failed to find leds node\n");
139 return -ENODEV; 138 return -ENODEV;