Browse Source

iommu/vt-d: Fix memory leak in dmar_insert_one_dev_info()

We are returning NULL if we are not able to attach the iommu
to the domain but while returning we missed freeing info.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Sudip Mukherjee 10 years ago
parent
commit
499f3aa432
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/iommu/intel-iommu.c

+ 1 - 0
drivers/iommu/intel-iommu.c

@@ -2301,6 +2301,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
 
 
 	if (ret) {
 	if (ret) {
 		spin_unlock_irqrestore(&device_domain_lock, flags);
 		spin_unlock_irqrestore(&device_domain_lock, flags);
+		free_devinfo_mem(info);
 		return NULL;
 		return NULL;
 	}
 	}