net: arc_emac: Fix memleak in arc_mdio_probe
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Sun, 23 Aug 2020 08:56:47 +0000 (16:56 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Aug 2020 00:59:44 +0000 (17:59 -0700)
commite2d79cd8875fa8c3cc7defa98a8cc99a1ed0c62f
tree94ebce0a519b63dceaf3ece3b01b57121532c9e2
parentf97c04c316d8fea16dca449fdfbe101fbdfee6a2
net: arc_emac: Fix memleak in arc_mdio_probe

When devm_gpiod_get_optional() fails, bus should be
freed just like when of_mdiobus_register() fails.

Fixes: 1bddd96cba03d ("net: arc_emac: support the phy reset for emac driver")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/arc/emac_mdio.c