]> git.dujemihanovic.xyz Git - linux.git/commit
net: phy: dp83822: Fix NULL pointer dereference on DP83825 devices
authorTomas Paukrt <tomaspaukrt@email.cz>
Fri, 6 Sep 2024 10:52:40 +0000 (12:52 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Sep 2024 23:20:15 +0000 (16:20 -0700)
commit3f62ea572b3e8e3f10c39a9cb4f04ca9ae5f2952
tree9017f5cc6cf49c721cc55edfdd8e3fb5040d557f
parent48aa361c5db0b380c2b75c24984c0d3e7c1e8c09
net: phy: dp83822: Fix NULL pointer dereference on DP83825 devices

The probe() function is only used for DP83822 and DP83826 PHY,
leaving the private data pointer uninitialized for the DP83825 models
which causes a NULL pointer dereference in the recently introduced/changed
functions dp8382x_config_init() and dp83822_set_wol().

Add the dp8382x_probe() function, so all PHY models will have a valid
private data pointer to fix this issue and also prevent similar issues
in the future.

Fixes: 9ef9ecfa9e9f ("net: phy: dp8382x: keep WOL settings across suspends")
Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/66w.ZbGt.65Ljx42yHo5.1csjxu@seznam.cz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/dp83822.c