kernel: net: phy: realtek: fix NULL pointer dereference
authorDaniel Golle <daniel@makrotopia.org>
Sun, 23 Apr 2023 17:46:02 +0000 (18:46 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 24 Apr 2023 02:16:26 +0000 (03:16 +0100)
commit6d33afd2b6b0b94c406141884410fee3dc4e08c3
treee8b5f458785994c0e76c291c710ab79aaa8dc3b0
parent0601f7134d5f86f75997453eb30590b0f578cbfb
kernel: net: phy: realtek: fix NULL pointer dereference

The previous attempt to replace an open coded paged read in the RealTek
Ethernet PHY driver was too naive and resulted in breaking the r8169
PCIe Ethernet driver which also makes use of the RealTek Ethernet PHY
driver.
Fix this by instead of using the (not yet populated) paged operations
rather use rtl821x_write_page and protect the whole paged read operation
using the MDIO bus mutex.

Fixes: 998b973157 ("kernel: net: phy: realtek: improve RealTek 2.5G PHY driver")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/generic/pending-5.15/726-net-phy-realtek-make-sure-paged-read-is-protected-by.patch [new file with mode: 0644]
target/linux/generic/pending-5.15/726-net-phy-realtek-use-phy_read_paged-instead-of-open-c.patch [deleted file]
target/linux/generic/pending-5.15/729-net-phy-realtek-introduce-rtl822x_probe.patch