projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
427c940
)
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
Jakub Kicinski
<kuba@kernel.org>
Wed, 23 Dec 2020 20:28:53 +0000
(12:28 -0800)
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
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/ethoc.c
b/drivers/net/ethernet/ethoc.c
index
0981fe9
..
3d9b0b1
100644
(file)
--- a/
drivers/net/ethernet/ethoc.c
+++ b/
drivers/net/ethernet/ethoc.c
@@
-1211,7
+1211,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);
@@
-1243,6
+1243,7
@@
error2:
netif_napi_del(&priv->napi);
error:
mdiobus_unregister(priv->mdio);
+free3:
mdiobus_free(priv->mdio);
free2:
clk_disable_unprepare(priv->clk);