]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:10:18 +0000 (20:10 +0100)
commit864794c48280a36b2f7e3fd781f3d04467c43985
tree33089aab511995116dce1e2887008ef3c1ba4056
parent658bd2e5ab2e375795310502848a30b416250977
net: ethernet: Fix memleak in ethoc_probe

[ Upstream commit 5d41f9b7ee7a5a5138894f58846a4ffed601498a ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/ethoc.c