提交 1643a35f 编写于 作者: M Mihnea Dobrescu-Balaur 提交者: Herbert Xu

crypto: ux500 - replace kmalloc and then memcpy with kmemdup

Signed-off-by: NMihnea Dobrescu-Balaur <mihneadb@gmail.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 5de88752
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册