linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] crypto: sun8i-ss - Fix memdup.cocci warnings
@ 2019-11-09  2:44 YueHaibing
  2019-11-12  7:03 ` Corentin Labbe
  2019-11-12  7:23 ` [PATCH v2 -next] crypto: sun8i-ce " YueHaibing
  0 siblings, 2 replies; 6+ messages in thread
From: YueHaibing @ 2019-11-09  2:44 UTC (permalink / raw)
  To: Corentin Labbe, Herbert Xu, Maxime Ripard, Chen-Yu Tsai
  Cc: YueHaibing, linux-crypto, linux-arm-kernel, linux-kernel,
	kernel-janitors

Use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
index f0e7c1e12da6..b6e7c346c3ae 100644
--- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
+++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
@@ -396,10 +396,9 @@ int sun8i_ce_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);
 
 	crypto_sync_skcipher_clear_flags(op->fallback_tfm, CRYPTO_TFM_REQ_MASK);
 	crypto_sync_skcipher_set_flags(op->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK);
@@ -422,10 +421,9 @@ int sun8i_ce_des3_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);
 
 	crypto_sync_skcipher_clear_flags(op->fallback_tfm, CRYPTO_TFM_REQ_MASK);
 	crypto_sync_skcipher_set_flags(op->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK);




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

* Re: [PATCH -next] crypto: sun8i-ss - Fix memdup.cocci warnings
  2019-11-09  2:44 [PATCH -next] crypto: sun8i-ss - Fix memdup.cocci warnings YueHaibing
@ 2019-11-12  7:03 ` Corentin Labbe
  2019-11-12  7:08   ` Yuehaibing
  2019-11-12  7:23 ` [PATCH v2 -next] crypto: sun8i-ce " YueHaibing
  1 sibling, 1 reply; 6+ messages in thread
From: Corentin Labbe @ 2019-11-12  7:03 UTC (permalink / raw)
  To: YueHaibing
  Cc: Herbert Xu, Maxime Ripard, Chen-Yu Tsai, linux-crypto,
	linux-arm-kernel, linux-kernel, kernel-janitors

On Sat, Nov 09, 2019 at 02:44:03AM +0000, YueHaibing wrote:
> Use kmemdup rather than duplicating its implementation
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---

Hello

Thanks but the patch was already sent by kbuild robot and merged.

Regards

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

* Re: [PATCH -next] crypto: sun8i-ss - Fix memdup.cocci warnings
  2019-11-12  7:03 ` Corentin Labbe
@ 2019-11-12  7:08   ` Yuehaibing
  0 siblings, 0 replies; 6+ messages in thread
From: Yuehaibing @ 2019-11-12  7:08 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: Herbert Xu, Maxime Ripard, Chen-Yu Tsai, linux-crypto,
	linux-arm-kernel, linux-kernel, kernel-janitors

On 2019/11/12 15:03, Corentin Labbe wrote:
> On Sat, Nov 09, 2019 at 02:44:03AM +0000, YueHaibing wrote:
>> Use kmemdup rather than duplicating its implementation
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
> 
> Hello
> 
> Thanks but the patch was already sent by kbuild robot and merged.

Sorry, this patch title should be "sun8i-ce" instead of "sun8i-ss",

kbuild robot indeed fix 'sun8i-ss' warning,  will resend v2.

> 
> Regards
> 
> 


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

* [PATCH v2 -next] crypto: sun8i-ce - Fix memdup.cocci warnings
  2019-11-09  2:44 [PATCH -next] crypto: sun8i-ss - Fix memdup.cocci warnings YueHaibing
  2019-11-12  7:03 ` Corentin Labbe
@ 2019-11-12  7:23 ` YueHaibing
  2019-11-16 19:47   ` Corentin Labbe
  2019-11-22 11:01   ` Herbert Xu
  1 sibling, 2 replies; 6+ messages in thread
From: YueHaibing @ 2019-11-12  7:23 UTC (permalink / raw)
  To: Corentin Labbe, Herbert Xu, Maxime Ripard, Chen-Yu Tsai
  Cc: YueHaibing, linux-crypto, linux-arm-kernel, linux-kernel,
	kernel-janitors

Use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: fix patch title 'sun8i-ss' -> 'sun8i-ce'
---
 drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
index f0e7c1e12da6..b6e7c346c3ae 100644
--- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
+++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
@@ -396,10 +396,9 @@ int sun8i_ce_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);
 
 	crypto_sync_skcipher_clear_flags(op->fallback_tfm, CRYPTO_TFM_REQ_MASK);
 	crypto_sync_skcipher_set_flags(op->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK);
@@ -422,10 +421,9 @@ int sun8i_ce_des3_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);
 
 	crypto_sync_skcipher_clear_flags(op->fallback_tfm, CRYPTO_TFM_REQ_MASK);
 	crypto_sync_skcipher_set_flags(op->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK);




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

* Re: [PATCH v2 -next] crypto: sun8i-ce - Fix memdup.cocci warnings
  2019-11-12  7:23 ` [PATCH v2 -next] crypto: sun8i-ce " YueHaibing
@ 2019-11-16 19:47   ` Corentin Labbe
  2019-11-22 11:01   ` Herbert Xu
  1 sibling, 0 replies; 6+ messages in thread
From: Corentin Labbe @ 2019-11-16 19:47 UTC (permalink / raw)
  To: YueHaibing
  Cc: Herbert Xu, Maxime Ripard, Chen-Yu Tsai, linux-crypto,
	linux-arm-kernel, linux-kernel, kernel-janitors

On Tue, Nov 12, 2019 at 07:23:14AM +0000, YueHaibing wrote:
> Use kmemdup rather than duplicating its implementation
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: fix patch title 'sun8i-ss' -> 'sun8i-ce'
> ---
>  drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 

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

Thanks

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

* Re: [PATCH v2 -next] crypto: sun8i-ce - Fix memdup.cocci warnings
  2019-11-12  7:23 ` [PATCH v2 -next] crypto: sun8i-ce " YueHaibing
  2019-11-16 19:47   ` Corentin Labbe
@ 2019-11-22 11:01   ` Herbert Xu
  1 sibling, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2019-11-22 11:01 UTC (permalink / raw)
  To: YueHaibing
  Cc: Corentin Labbe, Maxime Ripard, Chen-Yu Tsai, linux-crypto,
	linux-arm-kernel, linux-kernel, kernel-janitors

On Tue, Nov 12, 2019 at 07:23:14AM +0000, YueHaibing wrote:
> Use kmemdup rather than duplicating its implementation
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: fix patch title 'sun8i-ss' -> 'sun8i-ce'
> ---
>  drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 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] 6+ messages in thread

end of thread, other threads:[~2019-11-22 11:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-09  2:44 [PATCH -next] crypto: sun8i-ss - Fix memdup.cocci warnings YueHaibing
2019-11-12  7:03 ` Corentin Labbe
2019-11-12  7:08   ` Yuehaibing
2019-11-12  7:23 ` [PATCH v2 -next] crypto: sun8i-ce " YueHaibing
2019-11-16 19:47   ` Corentin Labbe
2019-11-22 11:01   ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).