]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/kexec: fix for_each_child.cocci warning
authorkernel test robot <lkp@intel.com>
Tue, 3 Aug 2021 14:59:55 +0000 (16:59 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 10 Aug 2021 13:14:55 +0000 (23:14 +1000)
for_each_node_by_type should have of_node_put() before return.

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

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2108031654080.17639@hadrien
arch/powerpc/kexec/core_64.c

index 84618d3c8013b3e17ac7ed4c0cdbef462c8fdf4c..89c069d664a5d3ba904680c21958f25f1c4d4cf0 100644 (file)
@@ -64,8 +64,10 @@ int default_machine_kexec_prepare(struct kimage *image)
                        begin = image->segment[i].mem;
                        end = begin + image->segment[i].memsz;
 
-                       if ((begin < high) && (end > low))
+                       if ((begin < high) && (end > low)) {
+                               of_node_put(node);
                                return -ETXTBSY;
+                       }
                }
        }