mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-16 12:04:08 +00:00
crypto: amlogic - Use kmemdup in meson_aes_setkey()
Use kmemdup rather than duplicating its implementation Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
427e6e3ad9
commit
d832a61285
1 changed files with 1 additions and 2 deletions
|
@ -372,10 +372,9 @@ int meson_aes_setkey(struct crypto_skcipher *tfm, const u8 *key,
|
|||
kfree(op->key);
|
||||
}
|
||||
op->keylen = keylen;
|
||||
op->key = kmalloc(keylen, GFP_KERNEL | GFP_DMA);
|
||||
op->key = kmemdup(key, keylen, GFP_KERNEL | GFP_DMA);
|
||||
if (!op->key)
|
||||
return -ENOMEM;
|
||||
memcpy(op->key, key, keylen);
|
||||
|
||||
return crypto_sync_skcipher_setkey(op->fallback_tfm, key, keylen);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue