提交 61e04ccb 编写于 作者: F Fugang Duan 提交者: David S. Miller

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: NFugang Duan <fugang.duan@nxp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 526f1cfb
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册