linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmicro: fix a missing check of clk_prepare
@ 2018-12-26  2:57 Kangjie Lu
  2018-12-28  0:21 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Kangjie Lu @ 2018-12-26  2:57 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	David S. Miller, Maxime Ripard, Chen-Yu Tsai, Maxime Coquelin,
	netdev, linux-arm-kernel, linux-stm32, linux-kernel

clk_prepare() could fail, so let's check its status, and if it fails,
return its error code upstream.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
index d07520fb969e..62ccbd47c1db 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
@@ -59,7 +59,9 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
 		gmac->clk_enabled = 1;
 	} else {
 		clk_set_rate(gmac->tx_clk, SUN7I_GMAC_MII_RATE);
-		clk_prepare(gmac->tx_clk);
+		ret = clk_prepare(gmac->tx_clk);
+		if (ret)
+			return ret;
 	}
 
 	return 0;
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: stmicro: fix a missing check of clk_prepare
  2018-12-26  2:57 [PATCH] net: stmicro: fix a missing check of clk_prepare Kangjie Lu
@ 2018-12-28  0:21 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-12-28  0:21 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, peppe.cavallaro, alexandre.torgue, joabreu,
	maxime.ripard, wens, mcoquelin.stm32, netdev, linux-arm-kernel,
	linux-stm32, linux-kernel

From: Kangjie Lu <kjlu@umn.edu>
Date: Tue, 25 Dec 2018 20:57:14 -0600

> clk_prepare() could fail, so let's check its status, and if it fails,
> return its error code upstream.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-28  0:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-26  2:57 [PATCH] net: stmicro: fix a missing check of clk_prepare Kangjie Lu
2018-12-28  0:21 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).