Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fe9723d authored by Alex Williamson's avatar Alex Williamson Committed by David Woodhouse
Browse files

intel-iommu: Fix get_domain_for_dev() error path



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: default avatarAlex Williamson <alex.williamson@redhat.com>
Acked-by: default avatarDonald Dutile <ddutile@redhat.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org
parent a97590e5
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1835,7 +1835,7 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw)


	ret = iommu_attach_domain(domain, iommu);
	ret = iommu_attach_domain(domain, iommu);
	if (ret) {
	if (ret) {
		domain_exit(domain);
		free_domain_mem(domain);
		goto error;
		goto error;
	}
	}