projects
/
wrapfs-4.13.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
658bd2e
)
net: ethernet: Fix memleak in ethoc_probe
author
Dinghao Liu
<dinghao.liu@zju.edu.cn>
Wed, 23 Dec 2020 11:06:12 +0000
(19:06 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:10:18 +0000
(20:10 +0100)
[ 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
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/ethoc.c
b/drivers/net/ethernet/ethoc.c
index 60da0499ad66c4db3b6b830259c3d9dbdecc7884..a2280c4be0f5165d6c81c604ba6c97f950373a98 100644
(file)
--- a/
drivers/net/ethernet/ethoc.c
+++ b/
drivers/net/ethernet/ethoc.c
@@
-1213,7
+1213,7
@@
static int ethoc_probe(struct platform_device *pdev)
ret = mdiobus_register(priv->mdio);
if (ret) {
dev_err(&netdev->dev, "failed to register MDIO bus\n");
- goto free
2
;
+ goto free
3
;
}
ret = ethoc_mdio_probe(netdev);
@@
-1245,6
+1245,7
@@
static int ethoc_probe(struct platform_device *pdev)
netif_napi_del(&priv->napi);
error:
mdiobus_unregister(priv->mdio);
+free3:
mdiobus_free(priv->mdio);
free2:
clk_disable_unprepare(priv->clk);