public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Jenkins <darrenrjenkins@gmail.com>
To: Kernel Janitors <kernel-janitors@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dougthompson@xmission.com, borislav.petkov@amd.com
Cc: bluesmoke-devel@lists.sourceforge.net
Subject: drivers/edac/ move a kfree() to after last use
Date: Mon, 21 Dec 2009 15:38:26 +1100	[thread overview]
Message-ID: <1261370306.11354.52.camel@ICE-BOX> (raw)


Move a kfree() below the last use of the memory

Coverity CID: 13142

Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index df5b684..15b8b3c 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2925,10 +2925,10 @@ static void __devexit
amd64_remove_one_instance(struct pci_dev *pdev)
 
 	amd64_free_mc_sibling_devices(pvt);
 
-	kfree(pvt);
 	mci->pvt_info = NULL;
 
 	mci_lookup[pvt->mc_node_id] = NULL;
+	kfree(pvt);
 
 	/* unregister from EDAC MCE */
 	amd_report_gart_errors(false);



             reply	other threads:[~2009-12-21  4:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21  4:38 Darren Jenkins [this message]
2009-12-21 15:18 ` drivers/edac/ move a kfree() to after last use Borislav Petkov

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=1261370306.11354.52.camel@ICE-BOX \
    --to=darrenrjenkins@gmail.com \
    --cc=bluesmoke-devel@lists.sourceforge.net \
    --cc=borislav.petkov@amd.com \
    --cc=dougthompson@xmission.com \
    --cc=kernel-janitors@vger.kernel.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