All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add exception handling
@ 2021-09-18  7:47 cgel.zte
  2021-09-18  8:12 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2021-09-18  7:47 UTC (permalink / raw)
  To: peterz
  Cc: jpoimboe, jbaron, rostedt, ardb, tglx, mingo, bp, x86, hpa,
	linux-kernel, Yang Guang

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-18  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-18  7:47 [PATCH] Add exception handling cgel.zte
2021-09-18  8:12 ` Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.