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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jul 2017 05:42:23 +0000 (07:42 +0200)
commit 1606043f214f912a52195293614935811a6e3e53 upstream.

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.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/atmel-sha.c

index 97e3479..6fcf25f 100644 (file)
@@ -1000,7 +1000,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;
 
        /*