linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: Fix jump label out_free_* in kvm_init()
@ 2019-11-23  2:45 linmiaohe
  2019-11-23 10:29 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: linmiaohe @ 2019-11-23  2:45 UTC (permalink / raw)
  To: pbonzini, rkrcmar; +Cc: linmiaohe, kvm, linux-kernel

From: Miaohe Lin <linmiaohe@huawei.com>

The jump label out_free_1 and out_free_2 deal with
the same stuff, so git rid of one and rename the
label out_free_0a to retain the label name order.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 virt/kvm/kvm_main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 13e6b7094596..00268290dcbd 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4354,12 +4354,12 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
 
 	r = kvm_arch_hardware_setup();
 	if (r < 0)
-		goto out_free_0a;
+		goto out_free_1;
 
 	for_each_online_cpu(cpu) {
 		smp_call_function_single(cpu, check_processor_compat, &r, 1);
 		if (r < 0)
-			goto out_free_1;
+			goto out_free_2;
 	}
 
 	r = cpuhp_setup_state_nocalls(CPUHP_AP_KVM_STARTING, "kvm/cpu:starting",
@@ -4416,9 +4416,8 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
 	unregister_reboot_notifier(&kvm_reboot_notifier);
 	cpuhp_remove_state_nocalls(CPUHP_AP_KVM_STARTING);
 out_free_2:
-out_free_1:
 	kvm_arch_hardware_unsetup();
-out_free_0a:
+out_free_1:
 	free_cpumask_var(cpus_hardware_enabled);
 out_free_0:
 	kvm_irqfd_exit();
-- 
2.19.1


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

* Re: [PATCH] KVM: Fix jump label out_free_* in kvm_init()
  2019-11-23  2:45 [PATCH] KVM: Fix jump label out_free_* in kvm_init() linmiaohe
@ 2019-11-23 10:29 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-11-23 10:29 UTC (permalink / raw)
  To: linmiaohe, rkrcmar; +Cc: kvm, linux-kernel

On 23/11/19 03:45, linmiaohe wrote:
> From: Miaohe Lin <linmiaohe@huawei.com>
> 
> The jump label out_free_1 and out_free_2 deal with
> the same stuff, so git rid of one and rename the
> label out_free_0a to retain the label name order.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  virt/kvm/kvm_main.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 13e6b7094596..00268290dcbd 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -4354,12 +4354,12 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
>  
>  	r = kvm_arch_hardware_setup();
>  	if (r < 0)
> -		goto out_free_0a;
> +		goto out_free_1;
>  
>  	for_each_online_cpu(cpu) {
>  		smp_call_function_single(cpu, check_processor_compat, &r, 1);
>  		if (r < 0)
> -			goto out_free_1;
> +			goto out_free_2;
>  	}
>  
>  	r = cpuhp_setup_state_nocalls(CPUHP_AP_KVM_STARTING, "kvm/cpu:starting",
> @@ -4416,9 +4416,8 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
>  	unregister_reboot_notifier(&kvm_reboot_notifier);
>  	cpuhp_remove_state_nocalls(CPUHP_AP_KVM_STARTING);
>  out_free_2:
> -out_free_1:
>  	kvm_arch_hardware_unsetup();
> -out_free_0a:
> +out_free_1:
>  	free_cpumask_var(cpus_hardware_enabled);
>  out_free_0:
>  	kvm_irqfd_exit();
> 

Queued, thanks.

Paolo


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

end of thread, other threads:[~2019-11-23 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-23  2:45 [PATCH] KVM: Fix jump label out_free_* in kvm_init() linmiaohe
2019-11-23 10:29 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).