diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-06-29 22:33:58 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-06-30 22:18:28 +0300 |
commit | b7d78b46d5e8dc77c656c13885d31e931923b915 (patch) | |
tree | 90e430f7a13c8256b4b350bd896a6a4a1c80b07f /net/bridge | |
parent | bf48c3fae6d78d6418f62bd3259cd62dd16f83ec (diff) | |
download | linux-b7d78b46d5e8dc77c656c13885d31e931923b915.tar.xz |
net: phylink: fix NULL pl->pcs dereference during phylink_pcs_poll_start
The current link mode of the phylink instance may not require an
attached PCS. However, phylink_major_config() unconditionally
dereferences this potentially NULL pointer when restarting the link poll
timer, which will panic the kernel.
Fix the problem by checking whether a PCS exists in phylink_pcs_poll_start(),
otherwise do nothing. The code prior to the blamed patch also only
looked at pcs->poll within an "if (pcs)" block.
Fixes: bfac8c490d60 ("net: phylink: disable PCS polling over major configuration")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tested-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Tested-by: Michael Walle <michael@walle.cc> # on kontron-kbox-a-230-ls
Tested-by: Nicolas Ferre <nicolas.ferre@microchip.com> # on sam9x60ek
Link: https://lore.kernel.org/r/20220629193358.4007923-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/bridge')
0 files changed, 0 insertions, 0 deletions