Message ID | 8540cb64b1f06710eaf41e3835c7ba3e21fa2b05.1638446239.git.christophe.leroy@csgroup.eu (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [v1,01/11] powerpc/code-patching: Remove pr_debug()/pr_devel() messages and fix check() | expand |
Le 02/12/2021 à 13:00, Christophe Leroy a écrit : > Do not silentely ignore a failure of create_branch() in > patch_branch(). Return -ERANGE. > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> From https://patchwork.ozlabs.org/project/linuxppc-dev/patch/4940b03de220d1dfe2c6b47a41e60925497ce125.1630657331.git.christophe.leroy@csgroup.eu/ Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> > --- > arch/powerpc/lib/code-patching.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c > index a43ca22313ee..e7a2a41ae8eb 100644 > --- a/arch/powerpc/lib/code-patching.c > +++ b/arch/powerpc/lib/code-patching.c > @@ -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); > } > >
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index a43ca22313ee..e7a2a41ae8eb 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c @@ -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); }
Do not silentely ignore a failure of create_branch() in patch_branch(). Return -ERANGE. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- arch/powerpc/lib/code-patching.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)