diff options
author | Fugang Duan <fugang.duan@nxp.com> | 2017-04-11 19:13:03 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-11 14:36:27 -0400 |
commit | 61e04ccbcbc4b1ba974af371e6f63906fb1d78fb (patch) | |
tree | ce2dc1eea8e8c452c4115490e77e6aafa62cd0a0 /drivers/net/ethernet/freescale/fec_main.c | |
parent | 526f1cfb1fc1521f2650accc080d16a7d802679d (diff) | |
download | op-kernel-dev-61e04ccbcbc4b1ba974af371e6f63906fb1d78fb.zip op-kernel-dev-61e04ccbcbc4b1ba974af371e6f63906fb1d78fb.tar.gz |
net: fec: add return value check after calling .of_property_read_u32()
Add return value check after calling .of_property_read_u32() to avoid
the warning reported by coverity.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/fec_main.c')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 91a1664..886a9c9 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3197,9 +3197,9 @@ static void fec_reset_phy(struct platform_device *pdev) if (!np) return; - of_property_read_u32(np, "phy-reset-duration", &msec); + err = of_property_read_u32(np, "phy-reset-duration", &msec); /* A sane reset duration should not be longer than 1s */ - if (msec > 1000) + if (!err && msec > 1000) msec = 1; phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0); |