lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150427225001-mutt-send-email-mst@redhat.com>
Date:	Mon, 27 Apr 2015 22:50:07 +0200
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	Julia Lawall <Julia.Lawall@...6.fr>
Cc:	Gleb Natapov <gleb@...nel.org>, zhanghy@...gfor.com,
	jasowang@...hat.com, kernel-janitors@...r.kernel.org,
	Paolo Bonzini <pbonzini@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: x86: drop unneeded null test

On Mon, Apr 27, 2015 at 10:35:34PM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@...6.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@...6.fr>

Acked-by: Michael S. Tsirkin <mst@...hat.com>

> 
> ---
>  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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ