projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2af13d6
)
net: tsec: Fix NULL access in case init_phy() fails
author
Claudiu Manoil
<claudiu.manoil@freescale.com>
Tue, 10 Dec 2013 13:21:04 +0000
(15:21 +0200)
committer
Joe Hershberger
<joe.hershberger@ni.com>
Fri, 30 Jan 2015 21:55:00 +0000
(15:55 -0600)
If the PHY is not recognized don't access phydev (NULL)
and return 0 to signal failure.
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/tsec.c
patch
|
blob
|
history
diff --git
a/drivers/net/tsec.c
b/drivers/net/tsec.c
index 79d656133adb4d50a7a28dfb529f81121db708ac..dcdba4ea827190759ea9ab0de43239a02024a096 100644
(file)
--- a/
drivers/net/tsec.c
+++ b/
drivers/net/tsec.c
@@
-597,6
+597,8
@@
static int init_phy(struct eth_device *dev)
tsec_configure_serdes(priv);
phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface);
+ if (!phydev)
+ return 0;
phydev->supported &= supported;
phydev->advertising = phydev->supported;