]> www.infradead.org Git - linux.git/commitdiff
KVM: arm64: free kvm->arch.nested_mmus with kvfree()
authorDanilo Krummrich <dakr@kernel.org>
Tue, 23 Jul 2024 14:20:52 +0000 (16:20 +0200)
committerOliver Upton <oliver.upton@linux.dev>
Fri, 2 Aug 2024 18:57:30 +0000 (18:57 +0000)
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>
arch/arm64/kvm/nested.c

index de789e0f1ae9cb6e1bc7ba0bd7bfe691df0143af..bab27f9d8cc659531291830ec79c13eb62aac4d0 100644 (file)
@@ -786,7 +786,7 @@ void kvm_arch_flush_shadow_all(struct kvm *kvm)
                if (!WARN_ON(atomic_read(&mmu->refcnt)))
                        kvm_free_stage2_pgd(mmu);
        }
-       kfree(kvm->arch.nested_mmus);
+       kvfree(kvm->arch.nested_mmus);
        kvm->arch.nested_mmus = NULL;
        kvm->arch.nested_mmus_size = 0;
        kvm_uninit_stage2_mmu(kvm);