Skip to content

Commit

Permalink
iommu/vt-d: returning free pointer in get_domain_for_dev()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and David Woodhouse committed Mar 28, 2014
1 parent 63b4262 commit 14d4056
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 14d4056

Please sign in to comment.