Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] crypto: mxc-scc - check clk_prepare_enable() error
@ 2016-08-22  2:37 Fabio Estevam
  2016-08-24 13:18 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2016-08-22  2:37 UTC (permalink / raw)
  To: herbert; +Cc: s.trumtrar, linux-crypto, Fabio Estevam

From: Fabio Estevam <fabio.estevam@nxp.com>

clk_prepare_enable() may fail, so we should better check its return
value and propagate it in the case of failure.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/crypto/mxc-scc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/mxc-scc.c b/drivers/crypto/mxc-scc.c
index ff383ef..ee4be1b0 100644
--- a/drivers/crypto/mxc-scc.c
+++ b/drivers/crypto/mxc-scc.c
@@ -668,7 +668,9 @@ static int mxc_scc_probe(struct platform_device *pdev)
 		return PTR_ERR(scc->clk);
 	}
 
-	clk_prepare_enable(scc->clk);
+	ret = clk_prepare_enable(scc->clk);
+	if (ret)
+		return ret;
 
 	/* clear error status register */
 	writel(0x0, scc->base + SCC_SCM_ERROR_STATUS);
-- 
1.9.1

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

end of thread, other threads:[~2016-08-24 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-22  2:37 [PATCH] crypto: mxc-scc - check clk_prepare_enable() error Fabio Estevam
2016-08-24 13:18 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox