From: Jeff Garzik <jeff@garzik.org>
To: akpm@linux-foundation.org
Cc: netdev@vger.kernel.org, afleming@freescale.com, danielm77@spray.se
Subject: Re: [patch for 2.6.27? 10/10] gianfar: free/iounmap memory after an error in mii bus initialization
Date: Wed, 24 Sep 2008 20:49:59 -0400 [thread overview]
Message-ID: <48DAE037.4040501@garzik.org> (raw)
In-Reply-To: <200809222110.m8MLAPWg029903@imap1.linux-foundation.org>
akpm@linux-foundation.org wrote:
> From: Andy Fleming <afleming@freescale.com>
>
> Recent changes to MII bus initialization code added exit points which
> didn't free or iounmap the bus before returning.
>
> Addresses http://bugzilla.kernel.org/show_bug.cgi?id=11372.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> Reported-by: Daniel Marjamki <danielm77@spray.se>
> Cc: Jeff Garzik <jeff@garzik.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/net/gianfar_mii.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff -puN drivers/net/gianfar_mii.c~gianfar-free-iounmap-memory-after-an-error-in-mii-bus-initialization drivers/net/gianfar_mii.c
> --- a/drivers/net/gianfar_mii.c~gianfar-free-iounmap-memory-after-an-error-in-mii-bus-initialization
> +++ a/drivers/net/gianfar_mii.c
> @@ -211,19 +211,21 @@ static int gfar_mdio_probe(struct device
> gfar_write(&enet_regs->tbipa, 0);
> for (i = PHY_MAX_ADDR; i > 0; i--) {
> u32 phy_id;
> - int r;
>
> - r = get_phy_id(new_bus, i, &phy_id);
> - if (r)
> - return r;
> + err = get_phy_id(new_bus, i, &phy_id);
> + if (err)
> + goto bus_register_fail;
>
> if (phy_id == 0xffffffff)
> break;
> }
>
> /* The bus is full. We don't support using 31 PHYs, sorry */
> - if (i == 0)
> - return -EBUSY;
> + if (i == 0) {
> + err = -EBUSY;
> +
> + goto bus_register_fail;
> + }
>
> gfar_write(&enet_regs->tbipa, i);
applied
prev parent reply other threads:[~2008-09-25 0:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-22 21:10 [patch for 2.6.27? 10/10] gianfar: free/iounmap memory after an error in mii bus initialization akpm
2008-09-25 0:49 ` Jeff Garzik [this message]
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=48DAE037.4040501@garzik.org \
--to=jeff@garzik.org \
--cc=afleming@freescale.com \
--cc=akpm@linux-foundation.org \
--cc=danielm77@spray.se \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).