2014-01-17 08:47:35

by Marek Szyprowski

[permalink] [raw]
Subject: [PATCH] cris: cryptocop: fix GFP_ATOMIC macro usage

GFP_ATOMIC is not a single gfp flag, but a macro which expands to the other
flags and LACK of __GFP_WAIT flag. To check if caller wanted to perform an
atomic allocation, the code must test __GFP_WAIT flag presence.

Signed-off-by: Marek Szyprowski <[email protected]>
---
arch/cris/arch-v32/drivers/cryptocop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index 877da19..7f2e60a 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -306,7 +306,7 @@ static void free_cdesc(struct cryptocop_dma_desc *cdesc)

static struct cryptocop_dma_desc *alloc_cdesc(int alloc_flag)
{
- int use_pool = (alloc_flag & GFP_ATOMIC) ? 1 : 0;
+ int use_pool = (alloc_flag & __GFP_WAIT) ? 0 : 1;
struct cryptocop_dma_desc *cdesc;

if (use_pool) {
--
1.7.9.5