lkml.org 
[lkml]   [2021]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Add exception handling
Date
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
\
 
 \ /
  Last update: 2021-09-18 09:48    [W:0.146 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site