The tn40xx driver works around a swnode implementation detail and drops
a firmware node reference it has not taken itself.
The first patch avoids releasing the firmware node prematurely if mdio
bus registration ever bails out before taking the reference, and the
second patch cleans up the implementation by switching to using a
primary software node.
This was something I stumbled over when reviewing the software node
implementation and the series has only been compile tested.
Johan
Changes in v2
- only drop the fwnode reference if it has been taken
- amend commit message and explain why this does not lead to a UAF
currently
- switch to primary software node (2/2, new patch)
v1: https://lore.kernel.org/all/20261110100051.2567443-1-johan@kernel.org/ (local)
Johan Hovold (2):
net: tn40xx: avoid early firmware node release
net: tn40xx: switch to primary software node
drivers/net/ethernet/tehuti/tn40_mdio.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
--
2.56.1