Commit c53717e1 authored by ruanjinjie's avatar ruanjinjie Committed by Juergen Gross

xen/platform-pci: add missing free_irq() in error path

free_irq() is missing in case of error in platform_pci_probe(), fix that.
Signed-off-by: default avatarruanjinjie <ruanjinjie@huawei.com>
Reviewed-by: default avatarOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Link: https://lore.kernel.org/r/20221114112124.1965611-1-ruanjinjie@huawei.comSigned-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 5e29500e
...@@ -144,7 +144,7 @@ static int platform_pci_probe(struct pci_dev *pdev, ...@@ -144,7 +144,7 @@ static int platform_pci_probe(struct pci_dev *pdev,
if (ret) { if (ret) {
dev_warn(&pdev->dev, "Unable to set the evtchn callback " dev_warn(&pdev->dev, "Unable to set the evtchn callback "
"err=%d\n", ret); "err=%d\n", ret);
goto out; goto irq_out;
} }
} }
...@@ -152,13 +152,16 @@ static int platform_pci_probe(struct pci_dev *pdev, ...@@ -152,13 +152,16 @@ static int platform_pci_probe(struct pci_dev *pdev,
grant_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); grant_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes);
ret = gnttab_setup_auto_xlat_frames(grant_frames); ret = gnttab_setup_auto_xlat_frames(grant_frames);
if (ret) if (ret)
goto out; goto irq_out;
ret = gnttab_init(); ret = gnttab_init();
if (ret) if (ret)
goto grant_out; goto grant_out;
return 0; return 0;
grant_out: grant_out:
gnttab_free_auto_xlat_frames(); gnttab_free_auto_xlat_frames();
irq_out:
if (!xen_have_vector_callback)
free_irq(pdev->irq, pdev);
out: out:
pci_release_region(pdev, 0); pci_release_region(pdev, 0);
mem_out: mem_out:
......
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