Skip to content

Commit

Permalink
powerpc/kexec: fix for_each_child.cocci warning
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kernel test robot authored and Michael Ellerman committed Aug 10, 2021
1 parent bd1dd4c commit c00103a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/powerpc/kexec/core_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit c00103a

Please sign in to comment.