public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: fix error return code in kvm_arch_vcpu_init()
@ 2013-04-17 23:41 Wei Yongjun
  2013-04-18  8:23 ` Paolo Bonzini
  2013-04-22  7:57 ` Gleb Natapov
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2013-04-17 23:41 UTC (permalink / raw)
  To: mtosatti, gleb, tglx, mingo, hpa; +Cc: yongjun_wei, x86, kvm

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 arch/x86/kvm/x86.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index e172132..c45d656 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6706,8 +6706,10 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
 	}
 	vcpu->arch.mcg_cap = KVM_MAX_MCE_BANKS;
 
-	if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL))
+	if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL)) {
+		r = -ENOMEM;
 		goto fail_free_mce_banks;
+	}
 
 	r = fx_init(vcpu);
 	if (r)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: x86: fix error return code in kvm_arch_vcpu_init()
  2013-04-17 23:41 [PATCH] KVM: x86: fix error return code in kvm_arch_vcpu_init() Wei Yongjun
@ 2013-04-18  8:23 ` Paolo Bonzini
  2013-04-22  7:57 ` Gleb Natapov
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2013-04-18  8:23 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: mtosatti, gleb, tglx, mingo, hpa, yongjun_wei, x86, kvm

Il 18/04/2013 01:41, Wei Yongjun ha scritto:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as returned elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  arch/x86/kvm/x86.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index e172132..c45d656 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -6706,8 +6706,10 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
>  	}
>  	vcpu->arch.mcg_cap = KVM_MAX_MCE_BANKS;
>  
> -	if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL))
> +	if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL)) {
> +		r = -ENOMEM;
>  		goto fail_free_mce_banks;
> +	}
>  
>  	r = fx_init(vcpu);
>  	if (r)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: x86: fix error return code in kvm_arch_vcpu_init()
  2013-04-17 23:41 [PATCH] KVM: x86: fix error return code in kvm_arch_vcpu_init() Wei Yongjun
  2013-04-18  8:23 ` Paolo Bonzini
@ 2013-04-22  7:57 ` Gleb Natapov
  1 sibling, 0 replies; 3+ messages in thread
From: Gleb Natapov @ 2013-04-22  7:57 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: mtosatti, tglx, mingo, hpa, yongjun_wei, x86, kvm

On Thu, Apr 18, 2013 at 07:41:00AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as returned elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Applied, thanks.

> ---
>  arch/x86/kvm/x86.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index e172132..c45d656 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -6706,8 +6706,10 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
>  	}
>  	vcpu->arch.mcg_cap = KVM_MAX_MCE_BANKS;
>  
> -	if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL))
> +	if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL)) {
> +		r = -ENOMEM;
>  		goto fail_free_mce_banks;
> +	}
>  
>  	r = fx_init(vcpu);
>  	if (r)

--
			Gleb.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-22  7:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-17 23:41 [PATCH] KVM: x86: fix error return code in kvm_arch_vcpu_init() Wei Yongjun
2013-04-18  8:23 ` Paolo Bonzini
2013-04-22  7:57 ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox