Skip to content

Commit

Permalink
xen/platform-pci: add missing free_irq() in error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ruanjinjie authored and Juergen Gross committed Nov 14, 2022
1 parent 5e29500 commit c53717e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/xen/platform-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,24 @@ 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;
}
}

max_nr_gframes = gnttab_max_grant_frames();
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:
Expand Down

0 comments on commit c53717e

Please sign in to comment.