Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: arm64: free kvm->arch.nested_mmus with kvfree()

kvm->arch.nested_mmus is allocated with kvrealloc(), hence free it with
kvfree() instead of kfree().

Fixes: 4f128f8e1aaa ("KVM: arm64: nv: Support multiple nested Stage-2 mmu structures")
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240723142204.758796-1-dakr@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>

authored by

Danilo Krummrich and committed by
Oliver Upton
32b9a52f 8400291e

+1 -1
+1 -1
arch/arm64/kvm/nested.c
··· 786 786 if (!WARN_ON(atomic_read(&mmu->refcnt))) 787 787 kvm_free_stage2_pgd(mmu); 788 788 } 789 - kfree(kvm->arch.nested_mmus); 789 + kvfree(kvm->arch.nested_mmus); 790 790 kvm->arch.nested_mmus = NULL; 791 791 kvm->arch.nested_mmus_size = 0; 792 792 kvm_uninit_stage2_mmu(kvm);