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

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
...@@ -191,7 +191,9 @@ int patch_branch(u32 *addr, unsigned long target, int flags) ...@@ -191,7 +191,9 @@ int patch_branch(u32 *addr, unsigned long target, int flags)
{ {
ppc_inst_t instr; ppc_inst_t instr;
create_branch(&instr, addr, target, flags); if (create_branch(&instr, addr, target, flags))
return -ERANGE;
return patch_instruction(addr, instr); return patch_instruction(addr, instr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment