summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorDan Carpenter2014-03-28 09:29:50 +0100
committerDavid Woodhouse2014-03-28 12:31:39 +0100
commit14d405699634d4ce0adfc7b4f52ac7427220a98d (patch)
tree56eacf795870fa5c4e9d868c68da30dc173ef951 /drivers/iommu
parentiommu/vt-d: Only call dmar_acpi_dev_scope_init() if DRHD units present (diff)
downloadkernel-qcow2-linux-14d405699634d4ce0adfc7b4f52ac7427220a98d.tar.gz
kernel-qcow2-linux-14d405699634d4ce0adfc7b4f52ac7427220a98d.tar.xz
kernel-qcow2-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;