summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/inside-secure
diff options
context:
space:
mode:
authorAntoine Tenart <antoine.tenart@bootlin.com>2018-02-13 09:26:57 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2018-02-22 15:16:28 +0100
commit57240a78be90d0ecdf6956e925d673bbcced5c32 (patch)
tree351e938ea68632b47b3acafb4cbeca9f82eeef59 /drivers/crypto/inside-secure
parentcrypto: inside-secure - keep the requests push/pop synced (diff)
downloadlinux-57240a78be90d0ecdf6956e925d673bbcced5c32.tar.xz
linux-57240a78be90d0ecdf6956e925d673bbcced5c32.zip
crypto: inside-secure - unmap the result in the hash send error path
This patch adds a label to unmap the result buffer in the hash send function error path. Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver") Suggested-by: Ofer Heifetz <oferh@marvell.com> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/inside-secure')
-rw-r--r--drivers/crypto/inside-secure/safexcel_hash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index 43e94cd59c86..a4960a934eef 100644
--- a/drivers/crypto/inside-secure/safexcel_hash.c
+++ b/drivers/crypto/inside-secure/safexcel_hash.c
@@ -303,7 +303,7 @@ send_command:
req->state_sz);
if (IS_ERR(rdesc)) {
ret = PTR_ERR(rdesc);
- goto cdesc_rollback;
+ goto unmap_result;
}
spin_unlock_bh(&priv->ring[ring].egress_lock);
@@ -315,6 +315,8 @@ send_command:
*results = 1;
return 0;
+unmap_result:
+ dma_unmap_sg(priv->dev, areq->src, req->nents, DMA_TO_DEVICE);
cdesc_rollback:
for (i = 0; i < n_cdesc; i++)
safexcel_ring_rollback_wptr(priv, &priv->ring[ring].cdr);