Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5befbd5a authored by Steffen Klassert's avatar Steffen Klassert Committed by Herbert Xu
Browse files

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: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f592682f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;