Skip to content

Commit

Permalink
crypto: ahash - Use GFP_KERNEL on allocation if the request can sleep
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
klassert authored and herbertx committed Jul 24, 2009
1 parent f592682 commit 5befbd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/ahash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 5befbd5

Please sign in to comment.