diff options
author | LABBE Corentin <clabbe.montjoie@gmail.com> | 2015-10-02 14:12:58 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-10-08 21:42:21 +0800 |
commit | 9d83d299549d0e121245d56954242750d0c14338 (patch) | |
tree | 62abe7e8947f5b24e20371dd34b0fb9ef970c308 /drivers/crypto/atmel-aes.c | |
parent | c6415a6016bff0b547c13cadb1d5e50e9ace2be3 (diff) | |
download | op-kernel-dev-9d83d299549d0e121245d56954242750d0c14338.zip op-kernel-dev-9d83d299549d0e121245d56954242750d0c14338.tar.gz |
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-aes.c')
-rw-r--r-- | drivers/crypto/atmel-aes.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 0f9a9dc..de8f5da 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -260,7 +260,11 @@ static struct atmel_aes_dev *atmel_aes_find_dev(struct atmel_aes_ctx *ctx) static int atmel_aes_hw_init(struct atmel_aes_dev *dd) { - clk_prepare_enable(dd->iclk); + int err; + + err = clk_prepare_enable(dd->iclk); + if (err) + return err; if (!(dd->flags & AES_FLAGS_INIT)) { atmel_aes_write(dd, AES_CR, AES_CR_SWRST); |