[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190530125213.GA22727@lunn.ch>
Date: Thu, 30 May 2019 14:52:13 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Ioana Ciornei <ioana.ciornei@....com>
Cc: linux@...linux.org.uk, f.fainelli@...il.com, hkallweit1@...il.com,
maxime.chevallier@...tlin.com, olteanv@...il.com,
thomas.petazzoni@...tlin.com, davem@...emloft.net,
vivien.didelot@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next] net: dsa: Add error path handling in
dsa_tree_setup()
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@....com>
> Reported-by: kernel test robot <rong.a.chen@...el.com>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists