public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Denis Kirjanov <kirjanov@gmail•com" <kirjanov@gmail•com>
To: davem@davemloft•net
Cc: michael.hennerich@analog•com, sonic.zhang@analog•com,
	cooloney@kernel•org, uclinux-dist-devel@blackfin•uclinux.org,
	netdev@vger•kernel.org
Subject: [PATCH] bfin_mac: fix memleak in mii_bus{probe|remove}
Date: Tue, 18 May 2010 13:28:39 +0400	[thread overview]
Message-ID: <20100518092839.GA21791@coldcone> (raw)

Fix memory leak with miibus->irq

Signed-off-by: Denis Kirjanov <dkirjanov@kernel•org>
---

drivers/net/bfin_mac.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 39a54ba..7a17b8a 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -1627,6 +1627,7 @@ static int __devinit bfin_mii_bus_probe(struct platform_device *pdev)
 
 out_err_mdiobus_register:
 	mdiobus_free(miibus);
+	kfree(miibus->irq);
 out_err_alloc:
 	peripheral_free_list(pin_req);
 
@@ -1638,6 +1639,7 @@ static int __devexit bfin_mii_bus_remove(struct platform_device *pdev)
 	struct mii_bus *miibus = platform_get_drvdata(pdev);
 	platform_set_drvdata(pdev, NULL);
 	mdiobus_unregister(miibus);
+	kfree(miibus->irq);
 	mdiobus_free(miibus);
 	peripheral_free_list(pin_req);
 	return 0;

             reply	other threads:[~2010-05-18  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18  9:28 Denis Kirjanov <kirjanov@gmail•com [this message]
2010-05-18 10:05 ` [PATCH] bfin_mac: fix memleak in mii_bus{probe|remove} Sonic Zhang
2010-05-18 11:34   ` Denis Kirjanov
2010-05-18 21:13     ` David Miller
2010-05-18 21:15       ` David Miller
2010-05-19  5:18       ` Denis Kirjanov

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=20100518092839.GA21791@coldcone \
    --to=kirjanov@gmail$(echo .)com \
    --cc=cooloney@kernel$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=michael.hennerich@analog$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sonic.zhang@analog$(echo .)com \
    --cc=uclinux-dist-devel@blackfin$(echo .)uclinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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