Commit 5befbd5a7e9c814d145f15b4281c88da96fb1aa9

Authored by Steffen Klassert
Committed by Herbert Xu
1 parent f592682f9f

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 <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -223,7 +223,7 @@
223 223  
224 224 priv = kmalloc(sizeof(*priv) + ahash_align_buffer_size(ds, alignmask),
225 225 (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ?
226   - GFP_ATOMIC : GFP_ATOMIC);
  226 + GFP_KERNEL : GFP_ATOMIC);
227 227 if (!priv)
228 228 return -ENOMEM;
229 229  
... ... @@ -333,7 +333,7 @@
333 333  
334 334 priv = kmalloc(sizeof(*priv) + ahash_align_buffer_size(ds, alignmask),
335 335 (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ?
336   - GFP_ATOMIC : GFP_ATOMIC);
  336 + GFP_KERNEL : GFP_ATOMIC);
337 337 if (!priv)
338 338 return -ENOMEM;
339 339