crypto: inside-secure - get the backlog before dequeueing the request
authorAntoine Ténart <antoine.tenart@free-electrons.com>
Thu, 15 Jun 2017 07:56:26 +0000 (09:56 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 20 Jun 2017 03:21:46 +0000 (11:21 +0800)
Get the backlog before dequeuing the request otherwise we'll miss the
first request in line.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel.c

index 8ae133a9e3f24a1fa47082b5b5bb23d6b213fce9..8f195e0319385146dec7e177058ca5f094b5b915 100644 (file)
@@ -431,8 +431,8 @@ void safexcel_dequeue(struct safexcel_crypto_priv *priv, int ring)
 
        do {
                spin_lock_bh(&priv->ring[ring].queue_lock);
-               req = crypto_dequeue_request(&priv->ring[ring].queue);
                backlog = crypto_get_backlog(&priv->ring[ring].queue);
+               req = crypto_dequeue_request(&priv->ring[ring].queue);
                spin_unlock_bh(&priv->ring[ring].queue_lock);
 
                if (!req)