Skip to content

Commit

Permalink
intel-iommu: Fix get_domain_for_dev() error path
Browse files Browse the repository at this point in the history
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@redhat.com>
Acked-by: Donald Dutile <ddutile@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org
  • Loading branch information
Alex Williamson authored and David Woodhouse committed Mar 12, 2011
1 parent a97590e commit 2fe9723
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2fe9723

Please sign in to comment.