mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
0ac7266485
commit
e2f8c5f6d4
1 changed files with 1 additions and 7 deletions
|
@ -2453,8 +2453,6 @@ static int domain_add_dev_info(struct dmar_domain *domain,
|
||||||
int translation)
|
int translation)
|
||||||
{
|
{
|
||||||
struct dmar_domain *ndomain;
|
struct dmar_domain *ndomain;
|
||||||
struct device_domain_info *info;
|
|
||||||
unsigned long flags;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ndomain = dmar_insert_dev_info(pci_domain_nr(pdev->bus),
|
ndomain = dmar_insert_dev_info(pci_domain_nr(pdev->bus),
|
||||||
|
@ -2465,11 +2463,7 @@ static int domain_add_dev_info(struct dmar_domain *domain,
|
||||||
|
|
||||||
ret = domain_context_mapping(domain, pdev, translation);
|
ret = domain_context_mapping(domain, pdev, translation);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
spin_lock_irqsave(&device_domain_lock, flags);
|
domain_remove_one_dev_info(domain, pdev);
|
||||||
info = pdev->dev.archdata.iommu;
|
|
||||||
unlink_domain_info(info);
|
|
||||||
spin_unlock_irqrestore(&device_domain_lock, flags);
|
|
||||||
free_devinfo_mem(info);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue