crypto: replace kmalloc and then memcpy with kmemdup
PATCH 1/1 crypto: replace kmalloc and then memcpy with kmemdup
Signed-off-by Mihnea Dobrescu-Balaur <[email protected]>
--- drivers/crypto/ux500/hash/hash_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/crypto/ux500/hash/hash_core.c +1 -3
@@ -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;
Signature · 1 line
1.7.10.4
Quoted 1 line · Mihnea Dobrescu-Balaur
Signed-off-by Mihnea Dobrescu-Balaur <[email protected]>
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Linus Walleij
Acked-byQuoted 4 lines · Herbert Xu
Quoted 1 line · Mihnea Dobrescu-Balaur
Signed-off-by Mihnea Dobrescu-Balaur <[email protected]>Patch applied. Thanks.
people involved with the code to ACK but somehow they must've missed it.
Thanks,
Linus Walleij