2021-09-07 12:06:48

by Jan Beulich

[permalink] [raw]
Subject: [PATCH 01/12] swiotlb-xen: avoid double free

Of the two paths leading to the "error" label in xen_swiotlb_init() one
didn't allocate anything, while the other did already free what was
allocated.

Fixes: b82776005369 ("xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used")
Signed-off-by: Jan Beulich <[email protected]>
Cc: [email protected]

--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -216,7 +216,6 @@ error:
goto retry;
}
pr_err("%s (rc:%d)\n", xen_swiotlb_error(m_ret), rc);
- free_pages((unsigned long)start, order);
return rc;
}



2021-09-08 07:48:51

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 01/12] swiotlb-xen: avoid double free

On Tue, Sep 07, 2021 at 02:04:25PM +0200, Jan Beulich wrote:
> Of the two paths leading to the "error" label in xen_swiotlb_init() one
> didn't allocate anything, while the other did already free what was
> allocated.
>
> Fixes: b82776005369 ("xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used")
> Signed-off-by: Jan Beulich <[email protected]>
> Cc: [email protected]

Looks good,

Reviewed-by: Christoph Hellwig <[email protected]>

2021-09-10 22:56:00

by Stefano Stabellini

[permalink] [raw]
Subject: Re: [PATCH 01/12] swiotlb-xen: avoid double free

On Tue, 7 Sep 2021, Jan Beulich wrote:
> Of the two paths leading to the "error" label in xen_swiotlb_init() one
> didn't allocate anything, while the other did already free what was
> allocated.
>
> Fixes: b82776005369 ("xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used")
> Signed-off-by: Jan Beulich <[email protected]>
> Cc: [email protected]

Reviewed-by: Stefano Stabellini <[email protected]>


> --- a/drivers/xen/swiotlb-xen.c
> +++ b/drivers/xen/swiotlb-xen.c
> @@ -216,7 +216,6 @@ error:
> goto retry;
> }
> pr_err("%s (rc:%d)\n", xen_swiotlb_error(m_ret), rc);
> - free_pages((unsigned long)start, order);
> return rc;
> }
>
>