Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61e04ccb authored by Fugang Duan's avatar Fugang Duan Committed by David S. Miller
Browse files

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: default avatarFugang Duan <fugang.duan@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 526f1cfb
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3197,9 +3197,9 @@ static void fec_reset_phy(struct platform_device *pdev)
	if (!np)
	if (!np)
		return;
		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 */
	/* A sane reset duration should not be longer than 1s */
	if (msec > 1000)
	if (!err && msec > 1000)
		msec = 1;
		msec = 1;


	phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
	phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);