Re: [PATCH 6/6] intel-iommu: Don't call domain_exit if can notattach with iommu

From: David Woodhouse
Date: Fri Apr 09 2010 - 11:43:26 EST


On Thu, 2010-04-08 at 19:58 +0100, Yinghai Lu wrote:
>
> --- a/drivers/pci/intel-iommu.c
> +++ b/drivers/pci/intel-iommu.c
> @@ -1853,7 +1853,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;
> }
>

Um, shouldn't the next error have the same change? If domain_init()
fails before it gets round to initialising the domain->devices list, the
same oops in domain_exit() will occur, won't it? It's because
domain->devices.{next,prev} are both NULL?

--
David Woodhouse Open Source Technology Centre
David.Woodhouse@xxxxxxxxx Intel Corporation

--
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/