summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/iio/adc/qcom-spmi-vadc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/iio/adc/qcom-spmi-vadc.c')
-rw-r--r--kernel/drivers/iio/adc/qcom-spmi-vadc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/drivers/iio/adc/qcom-spmi-vadc.c b/kernel/drivers/iio/adc/qcom-spmi-vadc.c
index 0c4618b4d..c2babe50a 100644
--- a/kernel/drivers/iio/adc/qcom-spmi-vadc.c
+++ b/kernel/drivers/iio/adc/qcom-spmi-vadc.c
@@ -839,8 +839,10 @@ static int vadc_get_dt_data(struct vadc_priv *vadc, struct device_node *node)
for_each_available_child_of_node(node, child) {
ret = vadc_get_dt_channel_data(vadc->dev, &prop, child);
- if (ret)
+ if (ret) {
+ of_node_put(child);
return ret;
+ }
vadc->chan_props[index] = prop;