summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crypto/scompress.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/scompress.c b/crypto/scompress.c
index 8db4613150e0..15148c58d648 100644
--- a/crypto/scompress.c
+++ b/crypto/scompress.c
@@ -128,11 +128,10 @@ static int crypto_scomp_init_tfm(struct crypto_tfm *tfm)
ret = crypto_acomp_alloc_streams(&alg->streams);
if (ret)
goto unlock;
- if (!scomp_scratch_users) {
+ if (!scomp_scratch_users++) {
ret = crypto_scomp_alloc_scratches();
if (ret)
- goto unlock;
- scomp_scratch_users++;
+ scomp_scratch_users--;
}
unlock:
mutex_unlock(&scomp_lock);