netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: (cpts) fix a missing check of clk_prepare
@ 2018-12-26  2:55 Kangjie Lu
  2018-12-28  0:21 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Kangjie Lu @ 2018-12-26  2:55 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, David S. Miller, Gustavo A. R. Silva, Florian Fainelli,
	Hernán Gonzalez, Ivan Khoronzhuk, netdev, 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/ti/cpts.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index b96b93c686bf..4f644ac314fe 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -572,7 +572,9 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs,
 		return ERR_CAST(cpts->refclk);
 	}
 
-	clk_prepare(cpts->refclk);
+	ret = clk_prepare(cpts->refclk);
+	if (ret)
+		return ERR_PTR(ret);
 
 	cpts->cc.read = cpts_systim_read;
 	cpts->cc.mask = CLOCKSOURCE_MASK(32);
-- 
2.17.2 (Apple Git-113)

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

* Re: [PATCH] net: (cpts) fix a missing check of clk_prepare
  2018-12-26  2:55 [PATCH] net: (cpts) 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, gustavo, f.fainelli, hernan, ivan.khoronzhuk, netdev,
	linux-kernel

From: Kangjie Lu <kjlu@umn.edu>
Date: Tue, 25 Dec 2018 20:55:37 -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:55 [PATCH] net: (cpts) 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).