crypto: atmel - only treat EBUSY as transient if backlog
authorGilad Ben-Yossef <gilad@benyossef.com>
Wed, 28 Jun 2017 07:22:03 +0000 (10:22 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 12 Jul 2017 10:38:06 +0000 (18:38 +0800)
The Atmel SHA driver was treating -EBUSY as indication of queueing
to backlog without checking that backlog is enabled for the request.

Fix it by checking request flags.

Cc: <stable@vger.kernel.org>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/atmel-sha.c

index a9482023d7d3799fbc44c4e5f0c4b39750151d12..dad4e5bad827ff5b46f938a21030300c8e76d66c 100644 (file)
@@ -1204,7 +1204,9 @@ static int atmel_sha_finup(struct ahash_request *req)
        ctx->flags |= SHA_FLAGS_FINUP;
 
        err1 = atmel_sha_update(req);
-       if (err1 == -EINPROGRESS || err1 == -EBUSY)
+       if (err1 == -EINPROGRESS ||
+           (err1 == -EBUSY && (ahash_request_flags(req) &
+                               CRYPTO_TFM_REQ_MAY_BACKLOG)))
                return err1;
 
        /*