net: ethernet: Fix memleak in ethoc_probe
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Wed, 23 Dec 2020 11:06:12 +0000 (19:06 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 23 Dec 2020 20:28:53 +0000 (12:28 -0800)
commit5d41f9b7ee7a5a5138894f58846a4ffed601498a
treebe65b2a5398e5abf061eca0de232d8ba757d55d7
parent427c940558560bff2583d07fc119a21094675982
net: ethernet: Fix memleak in ethoc_probe

When mdiobus_register() fails, priv->mdio allocated
by mdiobus_alloc() has not been freed, which leads
to memleak.

Fixes: e7f4dc3536a4 ("mdio: Move allocation of interrupts into core")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20201223110615.31389-1-dinghao.liu@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ethoc.c