summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-03-28 11:29:50 +0300
committerDavid Woodhouse <David.Woodhouse@intel.com>2014-03-28 11:31:39 +0000
commit14d405699634d4ce0adfc7b4f52ac7427220a98d (patch)
tree56eacf795870fa5c4e9d868c68da30dc173ef951 /drivers/iommu
parent63b4262478ee6384c7efb5279be54236e5d6361b (diff)
downloadlinux-14d405699634d4ce0adfc7b4f52ac7427220a98d.tar.gz
linux-14d405699634d4ce0adfc7b4f52ac7427220a98d.tar.bz2
linux-14d405699634d4ce0adfc7b4f52ac7427220a98d.zip
iommu/vt-d: returning free pointer in get_domain_for_dev()
If we hit this error condition then we want to return a NULL pointer and not a freed variable. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-iommu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 6fbce01b7875..69fa7da5e48b 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2257,6 +2257,7 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
goto error;
if (iommu_attach_domain(domain, iommu)) {
free_domain_mem(domain);
+ domain = NULL;
goto error;
}
free = domain;