]> git.baikalelectronics.ru Git - kernel.git/commit
net: phylink: don't call netif_carrier_off() with NULL netdev
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 17 Sep 2021 13:36:31 +0000 (14:36 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Sep 2021 12:23:47 +0000 (13:23 +0100)
commit2570774ed1ddba916f7026c51c33919f3eac377d
treea1638941e4d1d3acc7698f0e3ed5d1325ae1c77b
parent56a6c41c35b9d4efbb8860670e8259e84bf80491
net: phylink: don't call netif_carrier_off() with NULL netdev

Dan Carpenter points out that we have a code path that permits a NULL
netdev pointer to be passed to netif_carrier_off(), which will cause
a kernel oops. In any case, we need to set pl->old_link_state to false
to have the desired effect when there is no netdev present.

Fixes: 63edee332b15 ("net: phylink: add suspend/resume support")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c