diff options
author | Mihnea Dobrescu-Balaur <mihneadb@gmail.com> | 2013-03-11 11:48:10 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-03-21 10:44:41 +0100 |
commit | 1643a35fea3300c7df63c91596d3246c05b43a76 (patch) | |
tree | 9bc7ddfdafc78cbb642a8c3459afb32e9e88a913 /drivers/crypto/ux500 | |
parent | crypto: sahara - Add driver for SAHARA2 accelerator. (diff) | |
download | linux-1643a35fea3300c7df63c91596d3246c05b43a76.tar.xz linux-1643a35fea3300c7df63c91596d3246c05b43a76.zip |
crypto: ux500 - replace kmalloc and then memcpy with kmemdup
Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ux500')
-rw-r--r-- | drivers/crypto/ux500/hash/hash_core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 632c3339895f..8d16d3aa7650 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1368,14 +1368,12 @@ static int hash_setkey(struct crypto_ahash *tfm, /** * Freed in final. */ - ctx->key = kmalloc(keylen, GFP_KERNEL); + ctx->key = kmemdup(key, keylen, GFP_KERNEL); if (!ctx->key) { pr_err(DEV_DBG_NAME " [%s] Failed to allocate ctx->key " "for %d\n", __func__, alg); return -ENOMEM; } - - memcpy(ctx->key, key, keylen); ctx->keylen = keylen; return ret; |