diff options
author | LABBE Corentin <clabbe.montjoie@gmail.com> | 2015-10-02 15:12:58 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-10-08 16:42:21 +0300 |
commit | 9d83d299549d0e121245d56954242750d0c14338 (patch) | |
tree | 62abe7e8947f5b24e20371dd34b0fb9ef970c308 /drivers/crypto/atmel-sha.c | |
parent | c6415a6016bff0b547c13cadb1d5e50e9ace2be3 (diff) | |
download | linux-9d83d299549d0e121245d56954242750d0c14338.tar.xz |
crypto: atmel - Check for clk_prepare_enable() return value
clk_prepare_enable() can fail so add a check for this and
return the error code if it fails.
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-sha.c')
-rw-r--r-- | drivers/crypto/atmel-sha.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 5b35433c5399..5e6cf0891b4d 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -794,7 +794,11 @@ static void atmel_sha_finish_req(struct ahash_request *req, int err) static int atmel_sha_hw_init(struct atmel_sha_dev *dd) { - clk_prepare_enable(dd->iclk); + int err; + + err = clk_prepare_enable(dd->iclk); + if (err) + return err; if (!(SHA_FLAGS_INIT & dd->flags)) { atmel_sha_write(dd, SHA_CR, SHA_CR_SWRST); |