Commit d5937db1 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman
Browse files

powerpc/code-patching: Fix patch_branch() return on out-of-range failure



Do not silentely ignore a failure of create_branch() in
patch_branch(). Return -ERANGE.

Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/8540cb64b1f06710eaf41e3835c7ba3e21fa2b05.1638446239.git.christophe.leroy@csgroup.eu
parent 6b21af74
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -191,7 +191,9 @@ int patch_branch(u32 *addr, unsigned long target, int flags)
{
	ppc_inst_t instr;

	create_branch(&instr, addr, target, flags);
	if (create_branch(&instr, addr, target, flags))
		return -ERANGE;

	return patch_instruction(addr, instr);
}