Skip to content

net: stmmac: fix probe error handling and phydev leaks

Johan Hovold lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7net: ethernet: stmmac: dwmac-socfpga: fix use-after-free on probe errorsdrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c+19 -100 replies
2/7net: ethernet: stmmac: dwmac-sti: fix probe error pathdrivers/net/ethernet/stmicro/stmmac/dwmac-sti.c+10 -10 replies
3/7net: ethernet: stmmac: dwmac-rk: fix probe error pathdrivers/net/ethernet/stmicro/stmmac/dwmac-rk.c+10 -10 replies
4/7net: ethernet: stmmac: dwmac-generic: fix probe error pathdrivers/net/ethernet/stmicro/stmmac/dwmac-generic.c+11 -10 replies
5/7net: ethernet: stmmac: dwmac-meson8b: fix probe error pathdrivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c+10 -11 reply
6/7net: ethernet: stmmac: platform: fix outdated function headerdrivers/net/ethernet/stmicro/stmmac/stmmac_platform.c+0 -10 replies
7/7net: ethernet: stmmac: fix of-node and fixed-link-phydev leaksdrivers/net/ethernet/stmicro/stmmac/dwmac-generic.c drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c +10 more+156 -491 reply

Reviews trailers per patch

2 of 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMaxime RipardKevin HilmanGiuseppe Cavallaro
SeriesA-b
1/7
2/7
3/7
4/7
5/7A-b
6/7
7/7A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH net 0/7] net: stmmac: fix probe error handling and phydev leaks

This series fixes a number of issues with the stmmac-driver probe error handling, which for example left clocks enabled after probe failures.

The final patch fixes a failure to deregister and free any fixed-link PHYs that were registered during probe on probe errors and on driver unbind. It also fixes a related of-node leak on late probe errors.

This series depends on the of_phy_deregister_fixed_link() helper that was just merged to net.

As mentioned earlier, one staging driver also suffers from a similar leak and can be fixed up once the above mentioned helper hits mainline.

Note that these patches have only been compile tested.

Johan

Johan Hovold (7):
net: ethernet: stmmac: dwmac-socfpga: fix use-after-free on probe
errors
net: ethernet: stmmac: dwmac-sti: fix probe error path
net: ethernet: stmmac: dwmac-rk: fix probe error path
net: ethernet: stmmac: dwmac-generic: fix probe error path
net: ethernet: stmmac: dwmac-meson8b: fix probe error path
net: ethernet: stmmac: platform: fix outdated function header
net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks

 .../net/ethernet/stmicro/stmmac/dwmac-generic.c    | 17 ++++++++--
 .../net/ethernet/stmicro/stmmac/dwmac-ipq806x.c    | 25 ++++++++++----
 .../net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c    | 17 ++++++++--
 drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c  | 23 ++++++++++---
 .../net/ethernet/stmicro/stmmac/dwmac-meson8b.c    | 32 +++++++++++++-----
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c     | 21 +++++++++---
 .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c    | 39 ++++++++++++++--------
 drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c    | 23 ++++++++++---
 drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c  | 19 ++++++++---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c  | 26 +++++++++++----
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  1 -
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  | 33 +++++++++++++++---
 .../net/ethernet/stmicro/stmmac/stmmac_platform.h  |  2 ++
 13 files changed, 215 insertions(+), 63 deletions(-)
Signature · 1 line
2.7.3