net: phy: genphy_10g_driver: Avoid NULL pointer dereference
authorAndrew Lunn <andrew@lunn.ch>
Thu, 25 Oct 2018 12:42:38 +0000 (14:42 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Oct 2018 23:19:09 +0000 (16:19 -0700)
This driver got missed during the recent change of .features from a
u32 to a pointer to a Linux bitmap. Change the initialisation from 0
to PHY_10GBIT_FEATURES so removing the danger of a NULL pointer
dereference.

Fixes: 719655a14971 ("net: phy: Replace phy driver features u32 with link_mode bitmap")
Reported-by: Jose Abreu <jose.abreu@synopsys.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy-c45.c

index e122554..d7636ff 100644 (file)
@@ -329,7 +329,7 @@ struct phy_driver genphy_10g_driver = {
        .name           = "Generic 10G PHY",
        .soft_reset     = gen10g_no_soft_reset,
        .config_init    = gen10g_config_init,
-       .features       = 0,
+       .features       = PHY_10GBIT_FEATURES,
        .config_aneg    = gen10g_config_aneg,
        .read_status    = gen10g_read_status,
        .suspend        = gen10g_suspend,