netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Ioana Ciornei <ioana.ciornei@nxp.com>
Cc: linux@armlinux.org.uk, f.fainelli@gmail.com,
	hkallweit1@gmail.com, maxime.chevallier@bootlin.com,
	olteanv@gmail.com, thomas.petazzoni@bootlin.com,
	davem@davemloft.net, vivien.didelot@gmail.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH v2 net-next] net: dsa: Add error path handling in dsa_tree_setup()
Date: Thu, 30 May 2019 14:52:13 +0200	[thread overview]
Message-ID: <20190530125213.GA22727@lunn.ch> (raw)
In-Reply-To: <1559196547-17917-1-git-send-email-ioana.ciornei@nxp.com>

On Thu, May 30, 2019 at 09:09:07AM +0300, Ioana Ciornei wrote:
> In case a call to dsa_tree_setup() fails, an attempt to cleanup is made
> by calling dsa_tree_remove_switch(), which should take care of
> removing/unregistering any resources previously allocated. This does not
> happen because it is conditioned by dst->setup being true, which is set
> only after _all_ setup steps were performed successfully.
> 
> This is especially interesting when the internal MDIO bus is registered
> but afterwards, a port setup fails and the mdiobus_unregister() is never
> called. This leads to a BUG_ON() complaining about the fact that it's
> trying to free an MDIO bus that's still registered.
> 
> Add proper error handling in all functions branching from
> dsa_tree_setup().
> 
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> Reported-by: kernel test robot <rong.a.chen@intel.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

      reply	other threads:[~2019-05-30 12:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30  6:09 [PATCH v2 net-next] net: dsa: Add error path handling in dsa_tree_setup() Ioana Ciornei
2019-05-30 12:52 ` Andrew Lunn [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=20190530125213.GA22727@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vivien.didelot@gmail.com \
    /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).