Skip to content

Commit 5befbd5

Browse files
klassertherbertx
authored andcommitted
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>
1 parent f592682 commit 5befbd5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎crypto/ahash.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static int ahash_op_unaligned(struct ahash_request *req,
223223

224224
priv = kmalloc(sizeof(*priv) + ahash_align_buffer_size(ds, alignmask),
225225
(req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ?
226-
GFP_ATOMIC : GFP_ATOMIC);
226+
GFP_KERNEL : GFP_ATOMIC);
227227
if (!priv)
228228
return -ENOMEM;
229229

@@ -333,7 +333,7 @@ static int ahash_def_finup(struct ahash_request *req)
333333

334334
priv = kmalloc(sizeof(*priv) + ahash_align_buffer_size(ds, alignmask),
335335
(req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ?
336-
GFP_ATOMIC : GFP_ATOMIC);
336+
GFP_KERNEL : GFP_ATOMIC);
337337
if (!priv)
338338
return -ENOMEM;
339339

0 commit comments

Comments
 (0)