iommu/amd: Fix resource leak in iommu_init_device()
authorRadmila Kompová <xkompo00@stud.fit.vutbr.cz>
Thu, 2 May 2013 15:24:25 +0000 (17:24 +0200)
committerJoerg Roedel <joro@8bytes.org>
Wed, 14 Aug 2013 20:15:46 +0000 (22:15 +0200)
Detected by cppcheck.

Signed-off-by: Kamil Dudka <kdudka@redhat.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
drivers/iommu/amd_iommu.c

index 6dc659426a51f5cca55fdbaf2348b3c28fa03dde..72531f008a5e34ea871e7d3d3569a724af695d86 100644 (file)
@@ -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;