]> Git Repo - linux.git/commitdiff
powerpc/code-patching: Fix patch_branch() return on out-of-range failure
authorChristophe Leroy <[email protected]>
Thu, 2 Dec 2021 12:00:22 +0000 (13:00 +0100)
committerMichael Ellerman <[email protected]>
Thu, 23 Dec 2021 11:35:24 +0000 (22:35 +1100)
Do not silentely ignore a failure of create_branch() in
patch_branch(). Return -ERANGE.

Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/8540cb64b1f06710eaf41e3835c7ba3e21fa2b05.1638446239.git.christophe.leroy@csgroup.eu
arch/powerpc/lib/code-patching.c

index 3da7224fbd6e1f28165af8be94232ef614b12b01..998aeb9e1aac947366742ef13559a2ff61032a99 100644 (file)
@@ -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);
 }
 
This page took 0.064764 seconds and 4 git commands to generate.