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>
This commit is contained in:
Radmila Kompová 2013-05-02 17:24:25 +02:00 committed by Joerg Roedel
parent 82fcfc674e
commit e644a013fe

View 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;