Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452789 > unrolled thread

[PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference

Started byHeinrich Schuchardt <xypron.glpk@gmx.de>
First post2016-07-31 10:30 +0200
Last post2016-08-01 23:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-07-31 10:30 +0200
    Re: [PATCH 1/1] net: bcm63xx: avoid possible null pointer  dereference David Miller <davem@davemloft.net> - 2016-08-01 23:00 +0200

#1452789 — [PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-07-31 10:30 +0200
Subject[PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference
Message-ID<s0Uid-64o-7@gated-at.bofh.it>
If dev_get_platdata has failed pd is null.
Do not dereference a null pointer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 87c6b5b..6c8bc5f 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");
-- 
2.8.1

[toc] | [next] | [standalone]


#1453467 — Re: [PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference

FromDavid Miller <davem@davemloft.net>
Date2016-08-01 23:00 +0200
SubjectRe: [PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference
Message-ID<s1stz-32g-5@gated-at.bofh.it>
In reply to#1452789
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Sun, 31 Jul 2016 10:24:29 +0200

> If dev_get_platdata has failed pd is null.
> Do not dereference a null pointer.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web