From: Fugang Duan Date: Tue, 11 Apr 2017 11:13:03 +0000 (+0800) Subject: net: fec: add return value check after calling .of_property_read_u32() X-Git-Tag: v4.12-rc1~64^3~203^2~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=61e04ccbcbc4b1ba974af371e6f63906fb1d78fb;p=uclinux-h8%2Flinux.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 91a16641e851..886a9c9fd628 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);