aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/talitos.c
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2008-07-17 08:19:18 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2008-07-17 08:19:18 -0400
commit586725f8604ef16ebbfdd66e73036e162ae00135 (patch)
treeda771f80e1d2715b95e701da7af1f72cf622c3e1 /drivers/crypto/talitos.c
parentec6644d6325b5a38525f1d5b20fd4bf7db05cf2a (diff)
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>
Diffstat (limited to 'drivers/crypto/talitos.c')
-rw-r--r--drivers/crypto/talitos.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index fdb0680f6ffe..79fdba2a20c0 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1015,6 +1015,8 @@ static struct ipsec_esp_edesc *ipsec_esp_edesc_alloc(struct aead_request *areq,
1015 struct talitos_ctx *ctx = crypto_aead_ctx(authenc); 1015 struct talitos_ctx *ctx = crypto_aead_ctx(authenc);
1016 struct ipsec_esp_edesc *edesc; 1016 struct ipsec_esp_edesc *edesc;
1017 int src_nents, dst_nents, alloc_len, dma_len; 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 if (areq->cryptlen + ctx->authsize > TALITOS_MAX_DATA_LEN) { 1021 if (areq->cryptlen + ctx->authsize > TALITOS_MAX_DATA_LEN) {
1020 dev_err(ctx->dev, "cryptlen exceeds h/w max limit\n"); 1022 dev_err(ctx->dev, "cryptlen exceeds h/w max limit\n");
@@ -1046,7 +1048,7 @@ static struct ipsec_esp_edesc *ipsec_esp_edesc_alloc(struct aead_request *areq,
1046 alloc_len += icv_stashing ? ctx->authsize : 0; 1048 alloc_len += icv_stashing ? ctx->authsize : 0;
1047 } 1049 }
1048 1050
1049 edesc = kmalloc(alloc_len, GFP_DMA); 1051 edesc = kmalloc(alloc_len, GFP_DMA | flags);
1050 if (!edesc) { 1052 if (!edesc) {
1051 dev_err(ctx->dev, "could not allocate edescriptor\n"); 1053 dev_err(ctx->dev, "could not allocate edescriptor\n");
1052 return ERR_PTR(-ENOMEM); 1054 return ERR_PTR(-ENOMEM);
@@ -1508,7 +1510,7 @@ static int talitos_probe(struct of_device *ofdev,
1508 } 1510 }
1509 } 1511 }
1510 1512
1511 priv->submit_count = kmalloc(sizeof(int) * priv->num_channels, 1513 priv->submit_count = kmalloc(sizeof(atomic_t) * priv->num_channels,
1512 GFP_KERNEL); 1514 GFP_KERNEL);
1513 if (!priv->submit_count) { 1515 if (!priv->submit_count) {
1514 dev_err(dev, "failed to allocate fifo submit count space\n"); 1516 dev_err(dev, "failed to allocate fifo submit count space\n");