summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-08-26 14:31:50 +0000
committerJonathan Cameron <jic23@kernel.org>2016-08-29 19:51:17 +0100
commit943bbe743ce4c2846c41812186411841b0c9d7a1 (patch)
tree54d55f118dd3368bc7f7fc0487ae4c6dc726211e /drivers/iio
parent16335bcbf920d9903778d942ec5e579b25984b4b (diff)
downloadop-kernel-dev-943bbe743ce4c2846c41812186411841b0c9d7a1.zip
op-kernel-dev-943bbe743ce4c2846c41812186411841b0c9d7a1.tar.gz
iio: adc: ti-ads1015: add missing of_node_put() in ads1015_get_channels_config_of()
When terminating for_each_child_of_node() iteration with break or return, of_node_put() should be used to prevent stale device node references from being left behind. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/ti-ads1015.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
index 1ef39877..565e843 100644
--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -521,6 +521,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
if (pga > 6) {
dev_err(&client->dev, "invalid gain on %s\n",
node->full_name);
+ of_node_put(node);
return -EINVAL;
}
}
@@ -531,6 +532,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
dev_err(&client->dev,
"invalid data_rate on %s\n",
node->full_name);
+ of_node_put(node);
return -EINVAL;
}
}
OpenPOWER on IntegriCloud