[kvm-unit-tests PATCH 1/3] riscv: sbi: sse: Fix wrong sse stack initialization

Clément Léger cleger at rivosinc.com
Mon Jun 23 06:11:23 PDT 2025


The sse stack temporary storage wasn't correctly initialize to 0. Since
this is used to know if stack needs to be deallocated at the end (in
the error handling path), sse_stack_free() would crash if an error
happened while registering the sse event for instance. Fix this by
correctly initializing all the stacks entries.

Signed-off-by: Clément Léger <cleger at rivosinc.com>
---
 riscv/sbi-sse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/riscv/sbi-sse.c b/riscv/sbi-sse.c
index bc6afaf5..2bac5fff 100644
--- a/riscv/sbi-sse.c
+++ b/riscv/sbi-sse.c
@@ -957,8 +957,8 @@ static void sse_test_injection_priority_arg(struct priority_test_arg *in_args,
 			continue;
 
 		args[args_size] = arg;
+		event_args[args_size].stack = 0;
 		args_size++;
-		event_args->stack = 0;
 	}
 
 	if (!args_size) {
-- 
2.50.0




More information about the kvm-riscv mailing list