From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5040865539370631551==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] spi: spi-xilinx: fix for_each_child.cocci warnings Date: Tue, 21 Jun 2022 01:19:28 +0800 Message-ID: In-Reply-To: <202206210106.TM0vtap0-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============5040865539370631551== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com CC: linux-arm-kernel(a)lists.infradead.org TO: Amit Kumar Mahapatra CC: Michal Simek CC: Sai Krishna Potthuri CC: Tejas Prajapati Rameshchandra CC: Naga Sureshkumar Relli CC: Shubhrajyoti Datta CC: Ricardo Ribalda Delgado CC: Mark Brown CC: linux-spi(a)vger.kernel.org CC: linux-arm-kernel(a)lists.infradead.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/spi/spi-xilinx.c:692:1-33: WARNING: Function "for_each_available_ch= ild_of_node" should have of_node_put() before return around line 697. drivers/spi/spi-xilinx.c:692:1-33: WARNING: Function "for_each_available_ch= ild_of_node" should have of_node_put() before break around line 703. 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: 3973536c4560 ("spi: spi-xilinx: Updated axi-qspi controller driver") CC: Amit Kumar Mahapatra Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS head: 59523b5c4aca0174f1f8cba2a07d3b3328b7c80e commit: 3973536c456079bf3d09e9a97bf33d29422b183f [861/1181] spi: spi-xilinx= : Updated axi-qspi controller driver :::::: branch date: 5 days ago :::::: commit date: 5 months ago Please take the patch only if it's a positive warning. Thanks! drivers/spi/spi-xilinx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c @@ -693,13 +693,16 @@ static int xilinx_spi_probe(struct platf if (startup_block) { ret =3D of_property_read_u32(nc, "reg", &cs_num); - if (ret < 0) + if (ret < 0) { + of_node_put(nc); return -EINVAL; + } } ret =3D of_property_read_u32(nc, "spi-rx-bus-width", &rx_bus_width); if (!ret) { xspi->rx_bus_width =3D rx_bus_width; + of_node_put(nc); break; } } --===============5040865539370631551==--