Skip to content

Prevent nullptr exceptions in ISR

Andre Werner lkml netdev 5 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest posting 2/22 patches 2 repliesApplied 2/2
  2. v5 RFC posting 1/22 patches 0 repliesSuperseded
  3. v4 RFC2 patches 5 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v3 RFC2 patches2 repliesSuperseded
v2 RFC2 patches0 repliesSuperseded

Patches in v5 posting 2/2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2net: phy: phy_device: Prevent nullptr exceptions on ISRdrivers/net/phy/phy_device.c+8 -52 repliesApplied
2/2net: phy: adin1100: Add interrupt support for link changedrivers/net/phy/adin1100.c+55 -00 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAndrew Lunn
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [net-next v5 0/2] Prevent nullptr exceptions in ISR

In case phydev->irq is modified unconditionally to a valid IRQ, handling the IRQ may lead to a nullptr exception if no interrupt handler is registered to the phy driver. phy_interrupt calls a phy_device->handle_interrupt unconditionally. And interrupts are enabled in phy_connect_direct if phydev->irq is not equal to PHY_POLL or PHY_MAC_INTERRUPT, so it does not check for a phy driver providing an ISR.

Adding an additonal check for a valid interrupt handler in phy_attach_direct function, and falling back to polling mode if not, should prevent for such nullptr exceptions.

Moreover, the ADIN1100 phy driver is extended with an interrupt handler for changes in the link status.

Andre Werner (2):
net: phy: phy_device: Prevent nullptr exceptions on ISR
net: phy: adin1100: Add interrupt support for link change

 drivers/net/phy/adin1100.c   | 55 ++++++++++++++++++++++++++++++++++++
 drivers/net/phy/phy_device.c | 13 +++++----
 2 files changed, 63 insertions(+), 5 deletions(-)
Signature · 1 line
2.43.0