public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: fix for_each_child.cocci warnings
@ 2022-03-26  8:28 Julia Lawall
  2022-03-27 13:38 ` Jonathan Cameron
  2022-03-27 19:14 ` Andy Shevchenko
  0 siblings, 2 replies; 3+ messages in thread
From: Julia Lawall @ 2022-03-26  8:28 UTC (permalink / raw)
  To: kbuild-all, linux-arm-kernel, Rajnikant Bhojani, Michal Simek,
	Hyun Kwon, Shubhrajyoti Datta, Jean-Francois Dagenais,
	Olivier Dugas, Manish Narani, Jonathan Cameron,
	Lars-Peter Clausen, linux-iio, linux-arm-kernel, linux-kernel

From: kernel test robot <lkp@intel.com>

For_each_child_of_node should have of_node_put() before return.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

CC: Rajnikant Bhojani <rajnikant.bhojani@xilinx.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

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(+)

--- a/drivers/iio/adc/xilinx-ams.c
+++ b/drivers/iio/adc/xilinx-ams.c
@@ -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;
 			}


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: adc: fix for_each_child.cocci warnings
  2022-03-26  8:28 [PATCH] iio: adc: fix for_each_child.cocci warnings Julia Lawall
@ 2022-03-27 13:38 ` Jonathan Cameron
  2022-03-27 19:14 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2022-03-27 13:38 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kbuild-all, linux-arm-kernel, Rajnikant Bhojani, Michal Simek,
	Hyun Kwon, Shubhrajyoti Datta, Jean-Francois Dagenais,
	Olivier Dugas, Manish Narani, Lars-Peter Clausen, linux-iio,
	linux-kernel

On Sat, 26 Mar 2022 09:28:12 +0100 (CET)
Julia Lawall <julia.lawall@inria.fr> wrote:

> From: kernel test robot <lkp@intel.com>
> 
> For_each_child_of_node should have of_node_put() before return.
> 
> Generated by: scripts/coccinelle/iterators/for_each_child.cocci
> 
> CC: Rajnikant Bhojani <rajnikant.bhojani@xilinx.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>

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

> ---
> 
> 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(+)
> 
> --- a/drivers/iio/adc/xilinx-ams.c
> +++ b/drivers/iio/adc/xilinx-ams.c
> @@ -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;
>  			}
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: adc: fix for_each_child.cocci warnings
  2022-03-26  8:28 [PATCH] iio: adc: fix for_each_child.cocci warnings Julia Lawall
  2022-03-27 13:38 ` Jonathan Cameron
@ 2022-03-27 19:14 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2022-03-27 19:14 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kbuild-all, linux-arm Mailing List, Rajnikant Bhojani,
	Michal Simek, Hyun Kwon, Shubhrajyoti Datta,
	Jean-Francois Dagenais, Olivier Dugas, Manish Narani,
	Jonathan Cameron, Lars-Peter Clausen, linux-iio,
	Linux Kernel Mailing List

On Sat, Mar 26, 2022 at 12:28 PM Julia Lawall <julia.lawall@inria.fr> wrote:

> 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?

-- 
With Best Regards,
Andy Shevchenko

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-27 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-26  8:28 [PATCH] iio: adc: fix for_each_child.cocci warnings Julia Lawall
2022-03-27 13:38 ` Jonathan Cameron
2022-03-27 19:14 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox