diff --git a/arch/riscv/kernel/vector.c b/arch/riscv/kernel/vector.c index 12967f0e24ba0..f450ccc165f4c 100644 --- a/arch/riscv/kernel/vector.c +++ b/arch/riscv/kernel/vector.c @@ -116,7 +116,8 @@ static bool insn_is_matrix(u32 insn_buf) int riscv_v_thread_zalloc(struct task_struct *tsk) { void *datap; - + if (!riscv_v_vsize) + return -EINVAL; datap = kzalloc(riscv_v_vsize, GFP_KERNEL); if (!datap) return -ENOMEM;