All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Nelson <eric@nelint.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] net: fec_mxc: unregister mdio bus on probe error
Date: Tue, 8 Dec 2015 09:17:44 -0700	[thread overview]
Message-ID: <566702A8.6030400@nelint.com> (raw)
In-Reply-To: <1449589126-10530-2-git-send-email-mans@mansr.com>

Hi Mans,

On 12/08/2015 08:38 AM, Mans Rullgard wrote:
> If fecmxc_initialize_multi() fails, it frees but does not unregister
> the mdio bus, causing subsequent uses of the "mii" command to crash.
> Fix this by adding mdio_unregister() calls where needed.
> 
> Signed-off-by: Mans Rullgard <mans@mansr.com>
> ---
>  drivers/net/fec_mxc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 1250d2a..6c5e80b 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -1109,6 +1109,7 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
>  #ifdef CONFIG_PHYLIB
>  	phydev = phy_find_by_mask(bus, 1 << phy_id, PHY_INTERFACE_MODE_RGMII);
>  	if (!phydev) {
> +		mdio_unregister(bus);

While you're in here, this should probably be mdio_free just
to prevent somebody else from searching as I did.

>  		free(bus);
>  		return -ENOMEM;
>  	}
> @@ -1120,6 +1121,7 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
>  #ifdef CONFIG_PHYLIB
>  		free(phydev);
>  #endif
> +		mdio_unregister(bus);

Ditto:
>  		free(bus);
>  	}
>  	return ret;
> 

Otherwise,

Reviewed-by: Eric Nelson <eric@nelint.com>

  reply	other threads:[~2015-12-08 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 15:38 [U-Boot] [PATCH 1/2] net: fec_mxc: configure MDIO hold time Mans Rullgard
2015-12-08 15:38 ` [U-Boot] [PATCH 2/2] net: fec_mxc: unregister mdio bus on probe error Mans Rullgard
2015-12-08 16:17   ` Eric Nelson [this message]
2015-12-08 16:21     ` Måns Rullgård
2016-01-03 14:28   ` Stefano Babic
2015-12-08 16:08 ` [U-Boot] [PATCH 1/2] net: fec_mxc: configure MDIO hold time Eric Nelson
2016-01-03 14:27   ` Stefano Babic

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=566702A8.6030400@nelint.com \
    --to=eric@nelint.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.