]> git.baikalelectronics.ru Git - kernel.git/commit
net: phylink: avoid oops during initialisation
authorRussell King <rmk+kernel@armlinux.org.uk>
Fri, 28 Aug 2020 10:53:53 +0000 (11:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Aug 2020 19:23:16 +0000 (12:23 -0700)
commitf7f49960d6e75c0e6a76354d10b4faf9a7b8d4df
treebb718c235372164857750051ad3c79835423537d
parent64c31c388b1cf4f2e88cd071041108bbdca77f93
net: phylink: avoid oops during initialisation

If we intend to use PCS operations, mac_pcs_get_state() will not be
implemented, so will be NULL. If we also intend to register the PCS
operations in mac_prepare() or mac_config(), then this leads to an
attempt to call NULL function pointer during phylink_start(). Avoid
this, but we must report the link is down.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c