This patch series corrects a few resource leaks identified in the
zynq_gem and PHY code.

Back-story: in order to recover from rare wedges of our DP83867 PHY,
we're using the following hush snippet:

        until dhcp; do
                unbind ethernet 0;
                bind /axi/ethernet@ff0e0000 zynq_gem;
        done;

However, the unbind doesn't release the reset GPIO (so the re-bind
fails to reset the PHY), and the zynq_gem driver leaks memory that's
allocated during zynq_gem_probe and never released in zynq_gem_remove.

These patches are independent and either can be applied without the
other.

Changes in v2:
- zynq_gem: move mdio_free() out of the mdio_register_seq() failure
  branch and into the error label ladder (Michal Simek)
- zynq_gem: with CONFIG_DM_ETH_PHY, priv->bus may be a shared bus from
  eth_phy_get_mdio_bus(). Track whether we allocated it and only
  unregister/free it in that case, in both probe and remove (Michal
  Simek)

Graeme Smecher (2):
  net: zynq_gem: plug resource leaks in .probe error and .remove paths
  net: eth-phy: release the reset GPIO on device removal

 drivers/net/eth-phy-uclass.c | 14 ++++++++++++++
 drivers/net/zynq_gem.c       | 28 +++++++++++++++++++++-------
 2 files changed, 35 insertions(+), 7 deletions(-)

-- 
2.47.3

Reply via email to