iio: adc: fix for_each_child.cocci warnings
Subsystems (3)
PATCH 1/1 iio: adc: fix for_each_child.cocci warnings
From: kernel test robot <[email protected]>
For_each_child_of_node should have of_node_put() before return.
Generated by: scripts/coccinelle/iterators/for_each_child.cocci
---
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS head: 1870e0fa79a9d58c6748c34550f3ccea0b515933 commit: d073b83d3f8f3ba83c59f7502371b1cf9eb35e92 [541/1029] iio: adc: Add Xilinx AMS driver
:::::: branch date: 35 hours ago
:::::: commit date: 8 weeks ago
Please take the patch only if it's a positive warning. Thanks!
drivers/iio/adc/xilinx-ams.c | 1 + 1 file changed, 1 insertion(+)
drivers/iio/adc/xilinx-ams.c +1 -0
@@ -920,6 +920,7 @@ static int ams_parse_dt(struct iio_dev * ams_channels + num_channels);if (ret <0 ) {kfree (ams_channels); +of_node_put (child_node);return ret; }
Jonathan Cameron
maintainerQuoted 10 lines · On Sat, 26 Mar 2022 09:28:12 +0100 (CET) Julia Lawall <[email protected]>…
From: kernel test robot <[email protected]>
For_each_child_of_nodeshould haveof_node_put()before return.Generated by:
scripts/coccinelle/iterators/for_each_child.cocciCC Rajnikant Bhojani <[email protected]>Reported-by kernel test robot <[email protected]>Signed-off-by kernel test robot <[email protected]>Signed-off-by Julia Lawall <[email protected]>
The upstream version (in IIO for now, but I'd imagine will hit Linus' tree in next few days) of this looks rather different (no dt code an more) so I suspect this fix is for a now dead branch...
Jonathan
Quoted 23 lines
---
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS head: 1870e0fa79a9d58c6748c34550f3ccea0b515933 commit: d073b83d3f8f3ba83c59f7502371b1cf9eb35e92 [541/1029] iio: adc: Add Xilinx AMS driver:::::: branch date: 35 hours ago
:::::: commit date: 8 weeks agoPlease take the patch only if it's a positive warning. Thanks!
drivers/iio/adc/xilinx-ams.c | 1 + 1 file changed, 1 insertion(+)drivers/iio/adc/xilinx-ams.c +1
-0@@ -920,6 +920,7 @@ static int ams_parse_dt(struct iio_dev * ams_channels + num_channels);if (ret <0 ) {kfree (ams_channels); +of_node_put (child_node);return ret; }
Quoted 1 line · Julia Lawall
Please take the patch only if it's a positive warning. Thanks!
New code rightfully switched to the fwnode API
https://elixir.bootlin.com/linux/latest/source/drivers/iio/adc/xilinx-ams.c#L1254
Is your stuff only for LTS backports?
Signature · 2 lines
With Best Regards, Andy Shevchenko