From 77e7915b15bba2bf6edec6f258fb4158fef8e416 Mon Sep 17 00:00:00 2001 From: Ingi Kim Date: Mon, 16 Nov 2015 15:19:55 +0100 Subject: [PATCH] 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 Acked-by: Rob Herring Signed-off-by: Jacek Anaszewski --- drivers/leds/leds-ktd2692.c | 9 ++++++--- 1 file 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; } -- 2.20.1