]> git.karo-electronics.de Git - linux-beck.git/commitdiff
net: bcm63xx: avoid possible null pointer dereference
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>
Sun, 31 Jul 2016 08:24:29 +0000 (10:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Aug 2016 20:32:51 +0000 (13:32 -0700)
If dev_get_platdata has failed pd is null.
Do not dereference a null pointer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcm63xx_enet.c

index 87c6b5bdd6163d6aecb19bac0282a46cd0de4388..6c8bc5fadac7b33dc33dc248b6f0153661994269 100644 (file)
@@ -1859,7 +1859,7 @@ static int bcm_enet_probe(struct platform_device *pdev)
        } else {
 
                /* run platform code to initialize PHY device */
-               if (pd->mii_config &&
+               if (pd && pd->mii_config &&
                    pd->mii_config(dev, 1, bcm_enet_mdio_read_mii,
                                   bcm_enet_mdio_write_mii)) {
                        dev_err(&pdev->dev, "unable to configure mdio bus\n");