crypto: talitos - Fix GFP flag usage

use GFP_ATOMIC when necessary; use atomic_t when allocating submit_count.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Acked-by: Lee Nipper <lee.nipper@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Kim Phillips and committed by
Herbert Xu
586725f8 ec6644d6

+4 -2
+4 -2
drivers/crypto/talitos.c
··· 1015 1015 struct talitos_ctx *ctx = crypto_aead_ctx(authenc); 1016 1016 struct ipsec_esp_edesc *edesc; 1017 1017 int src_nents, dst_nents, alloc_len, dma_len; 1018 + gfp_t flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL : 1019 + GFP_ATOMIC; 1018 1020 1019 1021 if (areq->cryptlen + ctx->authsize > TALITOS_MAX_DATA_LEN) { 1020 1022 dev_err(ctx->dev, "cryptlen exceeds h/w max limit\n"); ··· 1048 1046 alloc_len += icv_stashing ? ctx->authsize : 0; 1049 1047 } 1050 1048 1051 - edesc = kmalloc(alloc_len, GFP_DMA); 1049 + edesc = kmalloc(alloc_len, GFP_DMA | flags); 1052 1050 if (!edesc) { 1053 1051 dev_err(ctx->dev, "could not allocate edescriptor\n"); 1054 1052 return ERR_PTR(-ENOMEM); ··· 1510 1508 } 1511 1509 } 1512 1510 1513 - priv->submit_count = kmalloc(sizeof(int) * priv->num_channels, 1511 + priv->submit_count = kmalloc(sizeof(atomic_t) * priv->num_channels, 1514 1512 GFP_KERNEL); 1515 1513 if (!priv->submit_count) { 1516 1514 dev_err(dev, "failed to allocate fifo submit count space\n");