Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1266195
| From | Ingi Kim <ingi2.kim@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] leds: ktd2692: Add missing of_node_put |
| Date | 2015-11-10 04:10 +0100 |
| Message-ID | <qt7tM-7Nw-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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>
---
drivers/leds/leds-ktd2692.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/leds/leds-ktd2692.c b/drivers/leds/leds-ktd2692.c
index feca07b..dbf37ce 100644
--- a/drivers/leds/leds-ktd2692.c
+++ b/drivers/leds/leds-ktd2692.c
@@ -332,21 +332,26 @@ 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;
+ }
+
+ return 0;
+err_parse_dt:
of_node_put(child_node);
return ret;
}
--
2.0.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] leds: ktd2692: Add missing of_node_put Ingi Kim <ingi2.kim@samsung.com> - 2015-11-10 04:10 +0100 Re: [PATCH] leds: ktd2692: Add missing of_node_put Rob Herring <robh+dt@kernel.org> - 2015-11-10 16:40 +0100 Re: [PATCH] leds: ktd2692: Add missing of_node_put Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-11-16 11:10 +0100
csiph-web