KVM: remove redundant code in kvm_arch_vm_ioctl
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 21 Oct 2019 02:52:56 +0000 (10:52 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Oct 2019 11:34:52 +0000 (13:34 +0200)
If we reach here with r = 0, we will reassign r = 0
unnecesarry, then do the label set_irqchip_out work.
If we reach here with r != 0, then we will do the label
work directly. So this if statement and r = 0 assignment
is redundant.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c

index 368a766..38131c8 100644 (file)
@@ -4910,9 +4910,6 @@ set_identity_unlock:
                if (!irqchip_kernel(kvm))
                        goto set_irqchip_out;
                r = kvm_vm_ioctl_set_irqchip(kvm, chip);
-               if (r)
-                       goto set_irqchip_out;
-               r = 0;
        set_irqchip_out:
                kfree(chip);
                break;