ASoC: cygnus: fix for_each_child.cocci warnings
authorkernel test robot <lkp@intel.com>
Sun, 28 Mar 2021 14:54:45 +0000 (16:54 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 29 Mar 2021 16:27:22 +0000 (17:27 +0100)
Function "for_each_available_child_of_node" should have of_node_put()
before return around line 1352.

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

CC: Sumera Priyadarsini <sylphrenadin@gmail.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>
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2103281651320.2854@hadrien
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/bcm/cygnus-ssp.c

index 6e634b44829306c87647668bf14f7e4b42f78d92..aa16a237513460bf63e0cc88651b2ff66e4d2f7e 100644 (file)
@@ -1348,8 +1348,10 @@ static int cygnus_ssp_probe(struct platform_device *pdev)
                                        &cygnus_ssp_dai[active_port_count]);
 
                /* negative is err, 0 is active and good, 1 is disabled */
-               if (err < 0)
+               if (err < 0) {
+                       of_node_put(child_node);
                        return err;
+               }
                else if (!err) {
                        dev_dbg(dev, "Activating DAI: %s\n",
                                cygnus_ssp_dai[active_port_count].name);