diff mbox series

spi: fix for_each_child.cocci warnings

Message ID alpine.DEB.2.22.394.2109021851450.52031@hadrien (mailing list archive)
State New, archived
Headers show
Series spi: fix for_each_child.cocci warnings | expand

Commit Message

Julia Lawall Sept. 2, 2021, 4:54 p.m. UTC
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(+)
diff mbox series

Patch

--- 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;
 		}
 	}