lkml.org 
[lkml]   [2015]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: x86: drop unneeded null test


On 27/04/2015 22:35, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> If the null test is needed, the call to cancel_delayed_work_sync would have
> already crashed. Normally, the destroy function should only be called
> if the init functoin has succeeded, in which case ioapic is not null.
>
> Problem found using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied, thanks.

Paolo

> ---
> arch/x86/kvm/ioapic.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/kvm/ioapic.c b2/arch/x86/kvm/ioapic.c
> index 28146f0..09828e2 100644
> --- a/arch/x86/kvm/ioapic.c
> +++ b2/arch/x86/kvm/ioapic.c
> @@ -637,11 +637,9 @@ void kvm_ioapic_destroy(struct kvm *kvm)
> struct kvm_ioapic *ioapic = kvm->arch.vioapic;
>
> cancel_delayed_work_sync(&ioapic->eoi_inject);
> - if (ioapic) {
> - kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS, &ioapic->dev);
> - kvm->arch.vioapic = NULL;
> - kfree(ioapic);
> - }
> + kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS, &ioapic->dev);
> + kvm->arch.vioapic = NULL;
> + kfree(ioapic);
> }
>
> int kvm_get_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state)
>


\
 
 \ /
  Last update: 2015-04-28 12:21    [W:0.034 / U:1.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site