* [PATCH] xen: add missing free_irq() in error path
@ 2022-11-14 7:07 ruanjinjie
2022-11-14 10:45 ` Oleksandr Tyshchenko
0 siblings, 1 reply; 3+ messages in thread
From: ruanjinjie @ 2022-11-14 7:07 UTC (permalink / raw)
To: jgross, sstabellini, oleksandr_tyshchenko, xen-devel, linux-kernel
Cc: ruanjinjie
free_irq() is missing in case of error, fix that.
Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
---
drivers/xen/platform-pci.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 18f0ed8b1f93..6ebd819338ec 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -144,7 +144,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;
}
}
@@ -152,13 +152,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:
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xen: add missing free_irq() in error path
2022-11-14 7:07 [PATCH] xen: add missing free_irq() in error path ruanjinjie
@ 2022-11-14 10:45 ` Oleksandr Tyshchenko
2022-11-14 11:11 ` Ruan Jinjie
0 siblings, 1 reply; 3+ messages in thread
From: Oleksandr Tyshchenko @ 2022-11-14 10:45 UTC (permalink / raw)
To: ruanjinjie; +Cc: jgross, sstabellini, xen-devel, linux-kernel
On 14.11.22 09:07, ruanjinjie wrote:
Hello
> free_irq() is missing in case of error, fix that.
>
> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
Nit: neither subject nor description mentions which subsystem current
patch targets.
I would add "xen-platform:" or "xen/platform-pci:" at least.
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Thanks.
> ---
> drivers/xen/platform-pci.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
> index 18f0ed8b1f93..6ebd819338ec 100644
> --- a/drivers/xen/platform-pci.c
> +++ b/drivers/xen/platform-pci.c
> @@ -144,7 +144,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;
> }
> }
>
> @@ -152,13 +152,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:
--
Regards,
Oleksandr Tyshchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xen: add missing free_irq() in error path
2022-11-14 10:45 ` Oleksandr Tyshchenko
@ 2022-11-14 11:11 ` Ruan Jinjie
0 siblings, 0 replies; 3+ messages in thread
From: Ruan Jinjie @ 2022-11-14 11:11 UTC (permalink / raw)
To: Oleksandr Tyshchenko; +Cc: jgross, sstabellini, xen-devel, linux-kernel
On 2022/11/14 18:45, Oleksandr Tyshchenko wrote:
>
> On 14.11.22 09:07, ruanjinjie wrote:
>
> Hello
>
>
>> free_irq() is missing in case of error, fix that.
>>
>> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
>
>
> Nit: neither subject nor description mentions which subsystem current
> patch targets.
>
> I would add "xen-platform:" or "xen/platform-pci:" at least.
>
Thank you very much!
>
> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>
> Thanks.
>
>> ---
>> drivers/xen/platform-pci.c | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
>> index 18f0ed8b1f93..6ebd819338ec 100644
>> --- a/drivers/xen/platform-pci.c
>> +++ b/drivers/xen/platform-pci.c
>> @@ -144,7 +144,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;
>> }
>> }
>>
>> @@ -152,13 +152,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:
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-14 11:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14 7:07 [PATCH] xen: add missing free_irq() in error path ruanjinjie
2022-11-14 10:45 ` Oleksandr Tyshchenko
2022-11-14 11:11 ` Ruan Jinjie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).