summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruanjinjie <ruanjinjie@huawei.com>2022-11-14 14:21:24 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-08 13:18:31 +0300
commite39808c43250009711d9fa840512c3b29e53df1e (patch)
tree322c6c527f62b1da27101a9a09237c1526d045ed
parentecb605851e2680961f0260539cf659911874dd9b (diff)
downloadlinux-e39808c43250009711d9fa840512c3b29e53df1e.tar.xz
xen/platform-pci: add missing free_irq() in error path
[ Upstream commit c53717e1e3f0d0f9129b2e0dbc6dcc5e0a8132e9 ] free_irq() is missing in case of error in platform_pci_probe(), fix that. Signed-off-by: ruanjinjie <ruanjinjie@huawei.com> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> Link: https://lore.kernel.org/r/20221114112124.1965611-1-ruanjinjie@huawei.com Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/xen/platform-pci.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 4cec8146609a..c7e190e5db30 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -150,7 +150,7 @@ static int platform_pci_probe(struct pci_dev *pdev,
if (ret) {
dev_warn(&pdev->dev, "Unable to set the evtchn callback "
"err=%d\n", ret);
- goto out;
+ goto irq_out;
}
}
@@ -158,13 +158,16 @@ static int platform_pci_probe(struct pci_dev *pdev,
grant_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes);
ret = gnttab_setup_auto_xlat_frames(grant_frames);
if (ret)
- goto out;
+ goto irq_out;
ret = gnttab_init();
if (ret)
goto grant_out;
return 0;
grant_out:
gnttab_free_auto_xlat_frames();
+irq_out:
+ if (!xen_have_vector_callback)
+ free_irq(pdev->irq, pdev);
out:
pci_release_region(pdev, 0);
mem_out: