All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio-crypto: Do not use GFP_ATOMIC when not needed
@ 2023-02-04 20:54 Christophe JAILLET
  2023-02-10  9:49   ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2023-02-04 20:54 UTC (permalink / raw)
  To: Gonglei, Michael S. Tsirkin, Jason Wang, Herbert Xu, David S. Miller
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
	virtualization, linux-crypto

There is no need to use GFP_ATOMIC here. GFP_KERNEL is already used for
another memory allocation just the line after.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch is speculative ! ! !

Maybe it is the other memory allocation that should use GFP_ATOMIC.

Review with care !
---
 drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
index b2979be613b8..6963344f6a3a 100644
--- a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
+++ b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
@@ -116,7 +116,7 @@ static int virtio_crypto_alg_akcipher_init_session(struct virtio_crypto_akcipher
 	struct virtio_crypto_session_input *input;
 	struct virtio_crypto_ctrl_request *vc_ctrl_req;
 
-	pkey = kmemdup(key, keylen, GFP_ATOMIC);
+	pkey = kmemdup(key, keylen, GFP_KERNEL);
 	if (!pkey)
 		return -ENOMEM;
 
-- 
2.34.1


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

* Re: [PATCH] virtio-crypto: Do not use GFP_ATOMIC when not needed
  2023-02-04 20:54 [PATCH] virtio-crypto: Do not use GFP_ATOMIC when not needed Christophe JAILLET
@ 2023-02-10  9:49   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2023-02-10  9:49 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Gonglei, Michael S. Tsirkin, Jason Wang, David S. Miller,
	linux-kernel, kernel-janitors, virtualization, linux-crypto

On Sat, Feb 04, 2023 at 09:54:08PM +0100, Christophe JAILLET wrote:
> There is no need to use GFP_ATOMIC here. GFP_KERNEL is already used for
> another memory allocation just the line after.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This patch is speculative ! ! !
> 
> Maybe it is the other memory allocation that should use GFP_ATOMIC.
> 
> Review with care !

Looks correct to me.  We don't support calling akcipher in atomic
contexts.

> ---
>  drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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

* Re: [PATCH] virtio-crypto: Do not use GFP_ATOMIC when not needed
@ 2023-02-10  9:49   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2023-02-10  9:49 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Michael S. Tsirkin, kernel-janitors, linux-kernel,
	virtualization, linux-crypto, David S. Miller

On Sat, Feb 04, 2023 at 09:54:08PM +0100, Christophe JAILLET wrote:
> There is no need to use GFP_ATOMIC here. GFP_KERNEL is already used for
> another memory allocation just the line after.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This patch is speculative ! ! !
> 
> Maybe it is the other memory allocation that should use GFP_ATOMIC.
> 
> Review with care !

Looks correct to me.  We don't support calling akcipher in atomic
contexts.

> ---
>  drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

end of thread, other threads:[~2023-02-10 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-04 20:54 [PATCH] virtio-crypto: Do not use GFP_ATOMIC when not needed Christophe JAILLET
2023-02-10  9:49 ` Herbert Xu
2023-02-10  9:49   ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.