From e644a013fe67f2bccd54378b88556d07fa2714d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radmila=20Kompov=C3=A1?= Date: Thu, 2 May 2013 17:24:25 +0200 Subject: iommu/amd: Fix resource leak in iommu_init_device() Detected by cppcheck. Signed-off-by: Kamil Dudka Signed-off-by: Joerg Roedel diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 6dc6594..72531f0 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; -- cgit v0.10.2