[PATCH AUTOSEL for 4.14 057/100] KVM: VMX: fix page leak in hardware_setup()

Sasha Levin
2018-01-28T23:06:40Z

From: Jim Mattson <jmattson@google.com>

[ Upstream commit 2895db67b01cb875457c9c3f30a14723b6b5dfd5 ]

vmx_io_bitmap_b should not be allocated twice.

Fixes: 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
arch/x86/kvm/vmx.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ef16cf0f7cfd..a7a44270bf25 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6756,7 +6756,6 @@ static __init int hardware_setup(void)
goto out;
}

- vmx_io_bitmap_b = (unsigned long *)__get_free_page(GFP_KERNEL);
memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE);
memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE);

--
2.11.0