crypto: ahash - Use GFP_KERNEL on allocation if the request can sleep
PATCH 1/1 crypto: ahash - Use GFP_KERNEL on allocation if the request can sleep
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 <[email protected]>
--- crypto/ahash.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
crypto/ahash.c +2 -2
@@ -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 ;
Signature · 1 line
1.5.4.2
Herbert Xu
maintainerQuoted 5 lines · Steffen Klassert
ahash_op_unaligned()andahash_def_finup()allocate memory atomically, regardless whether the request can sleep or not. This patch changes this to useGFP_KERNELif the request can sleep.Signed-off-by Steffen Klassert <[email protected]>
Doh, I don't know what I was thinking when I wrote that :)
Thanks for catching this, I'll apply the patch.
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt