From e644a013fe67f2bccd54378b88556d07fa2714d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Radmila=20Kompov=C3=A1?= Date: Thu, 2 May 2013 17:24:25 +0200 Subject: [PATCH] iommu/amd: Fix resource leak in iommu_init_device() Detected by cppcheck. Signed-off-by: Kamil Dudka Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.39.5