From: Denis Kirjanov <kirjanov@gmail.com>
To: dougthompson@xmission.com
Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
kirjanov@gmail.com
Subject: [PATCH 2/2] don't leak memory for mci_pdev
Date: Thu, 25 Oct 2012 19:43:23 +0400 [thread overview]
Message-ID: <1351179803-6625-1-git-send-email-kirjanov@gmail.com> (raw)
Don't leak allocated memory for mci_pdev
Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
---
drivers/edac/edac_mc_sysfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index ea34ece..689d7ba 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -1141,12 +1141,14 @@ int __init edac_mc_sysfs_init(void)
err = device_add(mci_pdev);
if (err < 0)
- return err;
+ goto out_dev_free;
edac_dbg(0, "device %s created\n", dev_name(mci_pdev));
return 0;
+out_dev_free:
+ kfree(mci_pdev);
out_put_sysfs:
edac_put_sysfs_subsys();
out:
@@ -1158,4 +1160,5 @@ void __exit edac_mc_sysfs_exit(void)
put_device(mci_pdev);
device_del(mci_pdev);
edac_put_sysfs_subsys();
+ kfree(mci_pdev);
}
--
1.7.9.5
reply other threads:[~2012-10-25 15:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1351179803-6625-1-git-send-email-kirjanov@gmail.com \
--to=kirjanov@gmail.com \
--cc=dougthompson@xmission.com \
--cc=linux-edac@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
all inboxes | Powered by JetHome®