From 323b15b997f3d07bb0dbc8906c7831b8f54f32f1 Mon Sep 17 00:00:00 2001 From: "xypron.glpk@gmx.de" Date: Sun, 31 Jul 2016 10:24:29 +0200 Subject: net: bcm63xx: avoid possible null pointer dereference If dev_get_platdata has failed pd is null. Do not dereference a null pointer. Signed-off-by: Heinrich Schuchardt Signed-off-by: David S. Miller --- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/ethernet/broadcom') diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 87c6b5bdd616..6c8bc5fadac7 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -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"); -- cgit v1.2.3