* [PATCH] spi: fix for_each_child.cocci warnings
@ 2021-09-02 16:54 Julia Lawall
0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2021-09-02 16:54 UTC (permalink / raw)
To: Amit Kumar Mahapatra
Cc: Michal Simek, Naga Sureshkumar Relli, Shubhrajyoti Datta,
P L Sai Krishna, Ranjit Waghmode, Tejas Prajapati Rameshchandra,
Rajan Vaja, kbuild-all, linux-arm-kernel
for_each_available_child_of_node should have of_node_put() before
escaping the loop via the breaks..
Generated by: scripts/coccinelle/iterators/for_each_child.cocci
Fixes: ffc5cb8494ba ("spi: Update ZynqMP and Versal QSPI controller driver")
CC: Amit Kumar Mahapatra <amit.kumar-mahapatra@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 master
head: 52495976d054651fbf88cb12e08c57bf8d0ad781
commit: ffc5cb8494ba2abe218134584b22fd874b71d504 [11243/12425] spi: Update ZynqMP and Versal QSPI controller driver
:::::: branch date: 2 days ago
:::::: commit date: 5 months ago
Please take the patch only if it's a positive warning. Thanks!
spi-zynqmp-gqspi.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -1362,6 +1362,7 @@ static int zynqmp_qspi_probe(struct plat
&rx_bus_width);
if (!ret) {
xqspi->rx_bus_width = rx_bus_width;
+ of_node_put(nc);
break;
}
}
@@ -1374,6 +1375,7 @@ static int zynqmp_qspi_probe(struct plat
&tx_bus_width);
if (!ret) {
xqspi->tx_bus_width = tx_bus_width;
+ of_node_put(nc);
break;
}
}
_______________________________________________
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] 2+ messages in thread
* [PATCH] spi: fix for_each_child.cocci warnings
@ 2021-12-17 22:46 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-12-17 22:46 UTC (permalink / raw)
To: Amit Kumar Mahapatra
Cc: kbuild-all, linux-arm-kernel, Michal Simek,
Naga Sureshkumar Relli, Shubhrajyoti Datta, P L Sai Krishna,
Ranjit Waghmode, Tejas Prajapati Rameshchandra, Rajan Vaja
From: kernel test robot <lkp@intel.com>
drivers/spi/spi-zynqmp-gqspi.c:1360:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before break around line 1365.
drivers/spi/spi-zynqmp-gqspi.c:1372:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before break around line 1377.
Semantic patch information:
False positives can be due to function calls within the for_each
loop that may encapsulate an of_node_put.
Generated by: scripts/coccinelle/iterators/for_each_child.cocci
Fixes: 5d37ab2cf69a ("spi: Update ZynqMP and Versal QSPI controller driver")
CC: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.10
head: 87ec9a2d98a7a7dfc98b57348a0ec310fd170e4b
commit: 5d37ab2cf69a5d4367f49fca798d78e4be66a43b [724/1981] spi: Update ZynqMP and Versal QSPI controller driver
:::::: branch date: 4 days ago
:::::: commit date: 7 months ago
Please take the patch only if it's a positive warning. Thanks!
spi-zynqmp-gqspi.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -1362,6 +1362,7 @@ static int zynqmp_qspi_probe(struct plat
&rx_bus_width);
if (!ret) {
xqspi->rx_bus_width = rx_bus_width;
+ of_node_put(nc);
break;
}
}
@@ -1374,6 +1375,7 @@ static int zynqmp_qspi_probe(struct plat
&tx_bus_width);
if (!ret) {
xqspi->tx_bus_width = tx_bus_width;
+ of_node_put(nc);
break;
}
}
_______________________________________________
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] 2+ messages in thread
end of thread, other threads:[~2021-12-17 22:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-17 22:46 [PATCH] spi: fix for_each_child.cocci warnings kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2021-09-02 16:54 Julia Lawall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).