Skip to content

Commit

Permalink
Staging: hv: vmbus: Cleanup error handling in vmbus_bus_init()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent 6de925b commit d6c1c5d
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions drivers/staging/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ static int vmbus_bus_init(int irq)
ret = hv_init();
if (ret != 0) {
pr_err("Unable to initialize the hypervisor - 0x%x\n", ret);
goto cleanup;
return ret;
}

/* Initialize the bus context */
Expand All @@ -544,10 +544,8 @@ static int vmbus_bus_init(int irq)

/* Now, register the bus with LDM */
ret = bus_register(&hv_bus);
if (ret) {
ret = -1;
goto cleanup;
}
if (ret)
return ret;

/* Get the interrupt resource */
ret = request_irq(irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
Expand All @@ -559,8 +557,7 @@ static int vmbus_bus_init(int irq)

bus_unregister(&hv_bus);

ret = -1;
goto cleanup;
return ret;
}

vector = IRQ0_VECTOR + irq;
Expand All @@ -574,14 +571,13 @@ static int vmbus_bus_init(int irq)
if (ret) {
free_irq(irq, hv_acpi_dev);
bus_unregister(&hv_bus);
goto cleanup;
return ret;
}


vmbus_request_offers();

cleanup:
return ret;
return 0;
}

/**
Expand Down

0 comments on commit d6c1c5d

Please sign in to comment.