crypto: sun4i-ss - fix missing unlock on error in sun4i_hash()
authorWei Yongjun <weiyj.lk@gmail.com>
Sat, 20 Aug 2016 10:48:53 +0000 (10:48 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 24 Aug 2016 13:04:49 +0000 (21:04 +0800)
Add the missing unlock before return from function sun4i_hash()
in the error handling case.

Fixes: 477d9b2e591b ("crypto: sun4i-ss - unify update/final function")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Corentin LABBE <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/sunxi-ss/sun4i-ss-hash.c

index 2ee3b59..1afeb8e 100644 (file)
@@ -245,7 +245,8 @@ int sun4i_hash(struct ahash_request *areq)
                if (end > areq->nbytes || areq->nbytes - end > 63) {
                        dev_err(ss->dev, "ERROR: Bound error %u %u\n",
                                end, areq->nbytes);
-                       return -EINVAL;
+                       err = -EINVAL;
+                       goto release_ss;
                }
        } else {
                /* Since we have the flag final, we can go up to modulo 4 */