Staging: hv: vmbus: Cleanup error handling in vmbus_bus_init()
Cleanup error handling in vmbus_bus_init(). Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6de925b189
commit
d6c1c5de4e
1 changed files with 6 additions and 10 deletions
|
@ -535,7 +535,7 @@ static int vmbus_bus_init(int irq)
|
||||||
ret = hv_init();
|
ret = hv_init();
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
pr_err("Unable to initialize the hypervisor - 0x%x\n", ret);
|
pr_err("Unable to initialize the hypervisor - 0x%x\n", ret);
|
||||||
goto cleanup;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the bus context */
|
/* Initialize the bus context */
|
||||||
|
@ -544,10 +544,8 @@ static int vmbus_bus_init(int irq)
|
||||||
|
|
||||||
/* Now, register the bus with LDM */
|
/* Now, register the bus with LDM */
|
||||||
ret = bus_register(&hv_bus);
|
ret = bus_register(&hv_bus);
|
||||||
if (ret) {
|
if (ret)
|
||||||
ret = -1;
|
return ret;
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the interrupt resource */
|
/* Get the interrupt resource */
|
||||||
ret = request_irq(irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
|
ret = request_irq(irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
|
||||||
|
@ -559,8 +557,7 @@ static int vmbus_bus_init(int irq)
|
||||||
|
|
||||||
bus_unregister(&hv_bus);
|
bus_unregister(&hv_bus);
|
||||||
|
|
||||||
ret = -1;
|
return ret;
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vector = IRQ0_VECTOR + irq;
|
vector = IRQ0_VECTOR + irq;
|
||||||
|
@ -574,14 +571,13 @@ static int vmbus_bus_init(int irq)
|
||||||
if (ret) {
|
if (ret) {
|
||||||
free_irq(irq, hv_acpi_dev);
|
free_irq(irq, hv_acpi_dev);
|
||||||
bus_unregister(&hv_bus);
|
bus_unregister(&hv_bus);
|
||||||
goto cleanup;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vmbus_request_offers();
|
vmbus_request_offers();
|
||||||
|
|
||||||
cleanup:
|
return 0;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue