diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2014-03-09 16:25:07 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2014-03-24 10:06:42 -0400 |
commit | e2f8c5f6d45b092b52adea9d71018ef11250b924 (patch) | |
tree | 3744253081cecc48a110f7199b0cfa90822c439f /drivers/iommu | |
parent | 0ac72664853b3181a437afb02a86d7c6f792e031 (diff) |
iommu/vt-d: Use domain_remove_one_dev_info() in domain_add_dev_info() error path
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/intel-iommu.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 7d3d33f5c8dc..84f0d4284125 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -2453,8 +2453,6 @@ static int domain_add_dev_info(struct dmar_domain *domain, | |||
2453 | int translation) | 2453 | int translation) |
2454 | { | 2454 | { |
2455 | struct dmar_domain *ndomain; | 2455 | struct dmar_domain *ndomain; |
2456 | struct device_domain_info *info; | ||
2457 | unsigned long flags; | ||
2458 | int ret; | 2456 | int ret; |
2459 | 2457 | ||
2460 | ndomain = dmar_insert_dev_info(pci_domain_nr(pdev->bus), | 2458 | ndomain = dmar_insert_dev_info(pci_domain_nr(pdev->bus), |
@@ -2465,11 +2463,7 @@ static int domain_add_dev_info(struct dmar_domain *domain, | |||
2465 | 2463 | ||
2466 | ret = domain_context_mapping(domain, pdev, translation); | 2464 | ret = domain_context_mapping(domain, pdev, translation); |
2467 | if (ret) { | 2465 | if (ret) { |
2468 | spin_lock_irqsave(&device_domain_lock, flags); | 2466 | domain_remove_one_dev_info(domain, pdev); |
2469 | info = pdev->dev.archdata.iommu; | ||
2470 | unlink_domain_info(info); | ||
2471 | spin_unlock_irqrestore(&device_domain_lock, flags); | ||
2472 | free_devinfo_mem(info); | ||
2473 | return ret; | 2467 | return ret; |
2474 | } | 2468 | } |
2475 | 2469 | ||