Re: [PATCH] riscv: kvm: fix vector context allocation leak

From: Osama Abdelkader

Date: Mon Mar 16 2026 - 11:24:41 EST


On Mon, Mar 16, 2026 at 10:23:27AM +0100, Markus Elfring wrote:
> > When the second kzalloc (host_context.vector.datap) fails in
> > kvm_riscv_vcpu_alloc_vector_context, the first allocation
> > (guest_context.vector.datap) is leaked. Free it before returning.
>
> Were any source code analysis tools involved here?
>

No, there were found during manual review.

>
> How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.0-rc4#n145
>

Done, I just sent v2, thank you.

> Regards,
> Markus

Best regards,
Osama