Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH -next] crypto: amlogic - Use kmemdup in meson_aes_setkey()
@ 2019-10-29  1:55 YueHaibing
  2019-10-29 12:42 ` LABBE Corentin
  2019-11-08 15:11 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2019-10-29  1:55 UTC (permalink / raw)
  To: Corentin Labbe, Herbert Xu
  Cc: YueHaibing, linux-crypto, linux-kernel, kernel-janitors

Use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/amlogic/amlogic-gxl-cipher.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
index e9283ffdbd23..78e776c58705 100644
--- a/drivers/crypto/amlogic/amlogic-gxl-cipher.c
+++ b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
@@ -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);
 }




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] crypto: amlogic - Use kmemdup in meson_aes_setkey()
  2019-10-29  1:55 [PATCH -next] crypto: amlogic - Use kmemdup in meson_aes_setkey() YueHaibing
@ 2019-10-29 12:42 ` LABBE Corentin
  2019-11-08 15:11 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: LABBE Corentin @ 2019-10-29 12:42 UTC (permalink / raw)
  To: YueHaibing; +Cc: Herbert Xu, linux-crypto, linux-kernel, kernel-janitors

On Tue, Oct 29, 2019 at 01:55:23AM +0000, YueHaibing wrote:
> Use kmemdup rather than duplicating its implementation
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/amlogic/amlogic-gxl-cipher.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
> index e9283ffdbd23..78e776c58705 100644
> --- a/drivers/crypto/amlogic/amlogic-gxl-cipher.c
> +++ b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
> @@ -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);
>  }
> 
> 
> 

Acked-by: Corentin Labbe <clabbe@baylibre.com>

Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] crypto: amlogic - Use kmemdup in meson_aes_setkey()
  2019-10-29  1:55 [PATCH -next] crypto: amlogic - Use kmemdup in meson_aes_setkey() YueHaibing
  2019-10-29 12:42 ` LABBE Corentin
@ 2019-11-08 15:11 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2019-11-08 15:11 UTC (permalink / raw)
  To: YueHaibing; +Cc: Corentin Labbe, linux-crypto, linux-kernel, kernel-janitors

On Tue, Oct 29, 2019 at 01:55:23AM +0000, YueHaibing wrote:
> Use kmemdup rather than duplicating its implementation
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/amlogic/amlogic-gxl-cipher.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29  1:55 [PATCH -next] crypto: amlogic - Use kmemdup in meson_aes_setkey() YueHaibing
2019-10-29 12:42 ` LABBE Corentin
2019-11-08 15:11 ` Herbert Xu

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git