aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/essiv.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/essiv.c')
-rw-r--r--crypto/essiv.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/crypto/essiv.c b/crypto/essiv.c
index a8befc8fb06e..aa6b89e91ac8 100644
--- a/crypto/essiv.c
+++ b/crypto/essiv.c
@@ -188,8 +188,12 @@ static void essiv_aead_done(struct crypto_async_request *areq, int err)
struct aead_request *req = areq->data;
struct essiv_aead_request_ctx *rctx = aead_request_ctx(req);
- if (rctx->assoc)
- kfree(rctx->assoc);
+ if (err == -EINPROGRESS)
+ goto out;
+
+ kfree(rctx->assoc);
+
+out:
aead_request_complete(req, err);
}
@@ -265,7 +269,7 @@ static int essiv_aead_crypt(struct aead_request *req, bool enc)
err = enc ? crypto_aead_encrypt(subreq) :
crypto_aead_decrypt(subreq);
- if (rctx->assoc && err != -EINPROGRESS)
+ if (rctx->assoc && err != -EINPROGRESS && err != -EBUSY)
kfree(rctx->assoc);
return err;
}