crypto: sun4i-ss - cannot use DMA is the request is 0 length
authorAntoine Ténart <antoine.tenart@free-electrons.com>
Thu, 1 Jun 2017 19:38:56 +0000 (21:38 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 19 Jun 2017 06:19:50 +0000 (14:19 +0800)
Do not use DMA is the request is 0 length.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/sunxi-ss/sun4i-ss-hash.c

index e53c312..bc3cbde 100644 (file)
@@ -250,7 +250,7 @@ static int sun4i_hash(struct ahash_request *areq)
                        i = 0;
                in_sg = sg_next(in_sg);
        }
-       if (i == 1 && !op->len)
+       if (i == 1 && !op->len && areq->nbytes)
                dev_dbg(ss->dev, "We can DMA\n");
 
        i = 0;