Thread (2 messages) 2 messages, 2 authors, 2009-07-22

[PATCH] crypto: ahash - Use GFP_KERNEL on allocation if the request can sleep

flat view
STALE6310d

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: 2009-07-22 09:48:48
Subsystem: crypto api, the rest · Maintainers: Herbert Xu, "David S. Miller", Linus Torvalds

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help