* [PATCH] crypto: ahash - Use GFP_KERNEL on allocation if the request can sleep
@ 2009-07-22 9:51 Steffen Klassert
2009-07-22 12:23 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Steffen Klassert @ 2009-07-22 9:51 UTC (permalink / raw)
To: Herbert Xu; +Cc: linux-crypto
ahash_op_unaligned() and ahash_def_finup() allocate memory atomically,
regardless whether the request can sleep or not. This patch changes
this to use GFP_KERNEL if the request can sleep.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
crypto/ahash.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/crypto/ahash.c b/crypto/ahash.c
index 28a33d0..33a4ff4 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -223,7 +223,7 @@ static int ahash_op_unaligned(struct ahash_request *req,
priv = kmalloc(sizeof(*priv) + ahash_align_buffer_size(ds, alignmask),
(req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ?
- GFP_ATOMIC : GFP_ATOMIC);
+ GFP_KERNEL : GFP_ATOMIC);
if (!priv)
return -ENOMEM;
@@ -333,7 +333,7 @@ static int ahash_def_finup(struct ahash_request *req)
priv = kmalloc(sizeof(*priv) + ahash_align_buffer_size(ds, alignmask),
(req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ?
- GFP_ATOMIC : GFP_ATOMIC);
+ GFP_KERNEL : GFP_ATOMIC);
if (!priv)
return -ENOMEM;
--
1.5.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: ahash - Use GFP_KERNEL on allocation if the request can sleep
2009-07-22 9:51 [PATCH] crypto: ahash - Use GFP_KERNEL on allocation if the request can sleep Steffen Klassert
@ 2009-07-22 12:23 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2009-07-22 12:23 UTC (permalink / raw)
To: Steffen Klassert; +Cc: linux-crypto
On Wed, Jul 22, 2009 at 11:51:23AM +0200, Steffen Klassert wrote:
> ahash_op_unaligned() and ahash_def_finup() allocate memory atomically,
> regardless whether the request can sleep or not. This patch changes
> this to use GFP_KERNEL if the request can sleep.
>
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Doh, I don't know what I was thinking when I wrote that :)
Thanks for catching this, I'll apply the patch.
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <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] 2+ messages in thread
end of thread, other threads:[~2009-07-22 12:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-22 9:51 [PATCH] crypto: ahash - Use GFP_KERNEL on allocation if the request can sleep Steffen Klassert
2009-07-22 12:23 ` 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.