mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
KVM: X86: Remove unnecessary GFP_KERNEL_ACCOUNT for temporary variables
Some variables allocated in kvm_arch_vcpu_ioctl are released when the function exits, so there is no need to set GFP_KERNEL_ACCOUNT. Signed-off-by: Peng Hao <flyingpeng@tencent.com> Link: https://lore.kernel.org/r/20240624012016.46133-1-flyingpeng@tencent.com Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
parent
8815d77cbc
commit
dd103407ca
|
|
@ -5884,8 +5884,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
|
||||||
r = -EINVAL;
|
r = -EINVAL;
|
||||||
if (!lapic_in_kernel(vcpu))
|
if (!lapic_in_kernel(vcpu))
|
||||||
goto out;
|
goto out;
|
||||||
u.lapic = kzalloc(sizeof(struct kvm_lapic_state),
|
u.lapic = kzalloc(sizeof(struct kvm_lapic_state), GFP_KERNEL);
|
||||||
GFP_KERNEL_ACCOUNT);
|
|
||||||
|
|
||||||
r = -ENOMEM;
|
r = -ENOMEM;
|
||||||
if (!u.lapic)
|
if (!u.lapic)
|
||||||
|
|
@ -6078,7 +6077,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
|
||||||
if (vcpu->arch.guest_fpu.uabi_size > sizeof(struct kvm_xsave))
|
if (vcpu->arch.guest_fpu.uabi_size > sizeof(struct kvm_xsave))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
u.xsave = kzalloc(sizeof(struct kvm_xsave), GFP_KERNEL_ACCOUNT);
|
u.xsave = kzalloc(sizeof(struct kvm_xsave), GFP_KERNEL);
|
||||||
r = -ENOMEM;
|
r = -ENOMEM;
|
||||||
if (!u.xsave)
|
if (!u.xsave)
|
||||||
break;
|
break;
|
||||||
|
|
@ -6109,7 +6108,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
|
||||||
case KVM_GET_XSAVE2: {
|
case KVM_GET_XSAVE2: {
|
||||||
int size = vcpu->arch.guest_fpu.uabi_size;
|
int size = vcpu->arch.guest_fpu.uabi_size;
|
||||||
|
|
||||||
u.xsave = kzalloc(size, GFP_KERNEL_ACCOUNT);
|
u.xsave = kzalloc(size, GFP_KERNEL);
|
||||||
r = -ENOMEM;
|
r = -ENOMEM;
|
||||||
if (!u.xsave)
|
if (!u.xsave)
|
||||||
break;
|
break;
|
||||||
|
|
@ -6127,7 +6126,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
|
||||||
}
|
}
|
||||||
|
|
||||||
case KVM_GET_XCRS: {
|
case KVM_GET_XCRS: {
|
||||||
u.xcrs = kzalloc(sizeof(struct kvm_xcrs), GFP_KERNEL_ACCOUNT);
|
u.xcrs = kzalloc(sizeof(struct kvm_xcrs), GFP_KERNEL);
|
||||||
r = -ENOMEM;
|
r = -ENOMEM;
|
||||||
if (!u.xcrs)
|
if (!u.xcrs)
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user