Re: [RESEND PATCH v2 2/2] intel-iommu: Fix get_domain_for_dev() error path
From: Yinghai Lu
Date: Thu Apr 21 2011 - 19:16:57 EST
On Fri, Mar 4, 2011 at 1:52 PM, Alex Williamson
<alex.williamson@xxxxxxxxxx> wrote:
> If we run out of domain_ids and fail iommu_attach_domain(), we
> fall into domain_exit() without having setup enough of the
> domain structure for this to do anything useful. In fact, it
> typically runs off into the weeds walking the bogus domain->devices
> list. Just free the domain.
>
> Signed-off-by: Alex Williamson <alex.williamson@xxxxxxxxxx>
> Acked-by: Donald Dutile <ddutile@xxxxxxxxxx>
> ---
>
> drivers/pci/intel-iommu.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
> index c58dbd7..4a66bea 100644
> --- a/drivers/pci/intel-iommu.c
> +++ b/drivers/pci/intel-iommu.c
> @@ -1835,7 +1835,7 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw)
>
> ret = iommu_attach_domain(domain, iommu);
> if (ret) {
> - domain_exit(domain);
> + free_domain_mem(domain);
> goto error;
> }
>
>
can you fix another path like David pointed out last year?
https://patchwork.kernel.org/patch/91732/
Thanks
Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/