Messages in this thread Patch in this message | | | From | cgel.zte@gmail ... | Subject | [PATCH] Add exception handling | Date | Sat, 18 Sep 2021 07:47:18 +0000 |
| |
From: Yang Guang <yang.guang5@zte.com.cn>
If the type is abnormal input from argument, the code will be NULL. So it should return as default;
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn> --- arch/x86/kernel/static_call.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/static_call.c b/arch/x86/kernel/static_call.c index f608e6710300..696da3eccf28 100644 --- a/arch/x86/kernel/static_call.c +++ b/arch/x86/kernel/static_call.c @@ -45,6 +45,8 @@ static void __ref __static_call_transform(void *insn, enum insn_type type, void code = text_gen_insn(RET_INSN_OPCODE, insn, func); size = RET_INSN_SIZE; break; + default: + return; } if (memcmp(insn, code, size) == 0) -- 2.25.1
| |