summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorIngi Kim <ingi2.kim@samsung.com>2015-11-16 15:19:55 +0100
committerJacek Anaszewski <j.anaszewski@samsung.com>2016-01-04 09:57:37 +0100
commit77e7915b15bba2bf6edec6f258fb4158fef8e416 (patch)
treecb286ca051256b346943c72f7aa2a92c5f28604a /drivers/leds
parentf16703360da7731a057df2ffa902306819c22398 (diff)
downloadlinux-77e7915b15bba2bf6edec6f258fb4158fef8e416.tar.bz2
leds: ktd2692: Add missing of_node_put
The refcount of device_node increases after of_node_get() is called. So, a break out of the loop requires of_node_put(). This patch adds missing of_node_put() when loop breaks. Signed-off-by: Ingi Kim <ingi2.kim@samsung.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-ktd2692.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/leds/leds-ktd2692.c b/drivers/leds/leds-ktd2692.c
index abd04bfbbdf9..bf23ba191ad0 100644
--- a/drivers/leds/leds-ktd2692.c
+++ b/drivers/leds/leds-ktd2692.c
@@ -306,21 +306,24 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev,
&cfg->movie_max_microamp);
if (ret) {
dev_err(dev, "failed to parse led-max-microamp\n");
- return ret;
+ goto err_parse_dt;
}
ret = of_property_read_u32(child_node, "flash-max-microamp",
&cfg->flash_max_microamp);
if (ret) {
dev_err(dev, "failed to parse flash-max-microamp\n");
- return ret;
+ goto err_parse_dt;
}
ret = of_property_read_u32(child_node, "flash-max-timeout-us",
&cfg->flash_max_timeout);
- if (ret)
+ if (ret) {
dev_err(dev, "failed to parse flash-max-timeout-us\n");
+ goto err_parse_dt;
+ }
+err_parse_dt:
of_node_put(child_node);
return ret;
}