mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Radmila Kompová" <xkompo00@stud.fit.vutbr.cz>
To: iommu@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] drivers/iommu/amd_iommu.c: fix resource leak in iommu_init_device()
Date: Thu, 02 May 2013 17:24:25 +0200	[thread overview]
Message-ID: <51828529.90900@stud.fit.vutbr.cz> (raw)

Detected by cppcheck.

Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
 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 8301837..5523ffb 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -448,8 +448,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;
-- 
1.8.1.5

             reply	other threads:[~2013-05-02 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 15:24 Radmila Kompová [this message]
2013-08-14 20:25 ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51828529.90900@stud.fit.vutbr.cz \
    --to=xkompo00@stud.fit.vutbr.cz \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®