Skip to content

Commit a04b30f

Browse files
atenartgregkh
authored andcommitted
crypto: inside-secure - do not process request if no command was issued
[ Upstream commit 95831ce ] This patch adds a check in the SafeXcel dequeue function, to avoid processing request further if no hardware command was issued. This can happen in certain cases where the ->send() function caches all the data that would have been send. Fixes: 809778e ("crypto: inside-secure - fix hash when length is a multiple of a block") Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 41b6f0f commit a04b30f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎drivers/crypto/inside-secure/safexcel.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,15 @@ void safexcel_dequeue(struct safexcel_crypto_priv *priv, int ring)
462462
if (backlog)
463463
backlog->complete(backlog, -EINPROGRESS);
464464

465+
/* In case the send() helper did not issue any command to push
466+
* to the engine because the input data was cached, continue to
467+
* dequeue other requests as this is valid and not an error.
468+
*/
469+
if (!commands && !results) {
470+
kfree(request);
471+
continue;
472+
}
473+
465474
spin_lock_bh(&priv->ring[ring].egress_lock);
466475
list_add_tail(&request->list, &priv->ring[ring].list);
467476
spin_unlock_bh(&priv->ring[ring].egress_lock);

0 commit comments

Comments
 (0)