Commit c35b739e authored by Julien's avatar Julien

libxdma: fix error handling

Currently err_engine and all following errors try to release the
resource they failed to create.
parent 5c7b8b10
...@@ -4431,15 +4431,15 @@ void *xdma_device_open(const char *mname, struct pci_dev *pdev, int *user_max, ...@@ -4431,15 +4431,15 @@ void *xdma_device_open(const char *mname, struct pci_dev *pdev, int *user_max,
rv = probe_engines(xdev); rv = probe_engines(xdev);
if (rv) if (rv)
goto err_engines; goto err_mask;
rv = enable_msi_msix(xdev, pdev); rv = enable_msi_msix(xdev, pdev);
if (rv < 0) if (rv < 0)
goto err_enable_msix; goto err_engines;
rv = irq_setup(xdev, pdev); rv = irq_setup(xdev, pdev);
if (rv < 0) if (rv < 0)
goto err_interrupts; goto err_msix;
if (!poll_mode) if (!poll_mode)
channel_interrupts_enable(xdev, ~0); channel_interrupts_enable(xdev, ~0);
...@@ -4454,9 +4454,7 @@ void *xdma_device_open(const char *mname, struct pci_dev *pdev, int *user_max, ...@@ -4454,9 +4454,7 @@ void *xdma_device_open(const char *mname, struct pci_dev *pdev, int *user_max,
xdma_device_flag_clear(xdev, XDEV_FLAG_OFFLINE); xdma_device_flag_clear(xdev, XDEV_FLAG_OFFLINE);
return (void *)xdev; return (void *)xdev;
err_interrupts: err_msix:
irq_teardown(xdev);
err_enable_msix:
disable_msi_msix(xdev, pdev); disable_msi_msix(xdev, pdev);
err_engines: err_engines:
remove_engines(xdev); remove_engines(xdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment