summaryrefslogtreecommitdiff
path: root/drivers/iommu/amd_iommu.c
diff options
context:
space:
mode:
authorRadmila Kompová <xkompo00@stud.fit.vutbr.cz>2013-05-02 17:24:25 +0200
committerJoerg Roedel <joro@8bytes.org>2013-08-14 22:15:46 +0200
commite644a013fe67f2bccd54378b88556d07fa2714d6 (patch)
treeffb0f31cee8b136e15a5f282bdeccc10d0981dd5 /drivers/iommu/amd_iommu.c
parent82fcfc674ebe2a0d83a6dd1b6ffa5589a94e4d4c (diff)
iommu/amd: Fix resource leak in iommu_init_device()
Detected by cppcheck. Signed-off-by: Kamil Dudka <kdudka@redhat.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r--drivers/iommu/amd_iommu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 6dc659426a51..72531f008a5e 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -456,8 +456,10 @@ static int iommu_init_device(struct device *dev)
}
ret = init_iommu_group(dev);
- if (ret)
+ if (ret) {
+ free_dev_data(dev_data);
return ret;
+ }
if (pci_iommuv2_capable(pdev)) {
struct amd_iommu *iommu;