linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference
@ 2016-07-31  8:24 Heinrich Schuchardt
  2016-08-01 20:44 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2016-07-31  8:24 UTC (permalink / raw)
  To: Florian Fainelli, bcm-kernel-feedback-list
  Cc: David S . Miller, Andrew Lunn, Ivan Vecera, Simon Arlott,
	Thierry Reding, netdev, linux-arm-kernel, linux-kernel,
	Heinrich Schuchardt

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference
  2016-07-31  8:24 [PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference Heinrich Schuchardt
@ 2016-08-01 20:44 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-08-01 20:44 UTC (permalink / raw)
  To: xypron.glpk
  Cc: f.fainelli, bcm-kernel-feedback-list, andrew, ivecera, simon,
	treding, netdev, linux-arm-kernel, linux-kernel

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-01 20:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-31  8:24 [PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference Heinrich Schuchardt
2016-08-01 20:44 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).