提交 d5937db1 编写于 作者: C Christophe Leroy 提交者: 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: NChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/8540cb64b1f06710eaf41e3835c7ba3e21fa2b05.1638446239.git.christophe.leroy@csgroup.eu
上级 6b21af74
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册