diff options
author | Ioana Ciornei | 2019-05-30 08:09:07 +0200 |
---|---|---|
committer | David S. Miller | 2019-05-30 23:58:31 +0200 |
commit | e70c7aad7a95f4f9fd3f00caef1a1ceb57a4b5a4 (patch) | |
tree | e0ee84f322f4a3ba72896f90d9cd0dd1b765ea1f /drivers/net/ethernet/intel/ice | |
parent | Merge branch 'r8169-fw' (diff) | |
download | kernel-qcow2-linux-e70c7aad7a95f4f9fd3f00caef1a1ceb57a4b5a4.tar.gz kernel-qcow2-linux-e70c7aad7a95f4f9fd3f00caef1a1ceb57a4b5a4.tar.xz kernel-qcow2-linux-e70c7aad7a95f4f9fd3f00caef1a1ceb57a4b5a4.zip |
net: dsa: Add error path handling in dsa_tree_setup()
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/ice')
0 files changed, 0 insertions, 0 deletions