diff options
Diffstat (limited to 'crypto/aead.c')
-rw-r--r-- | crypto/aead.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/aead.c b/crypto/aead.c index 7c3d725bd264..35c55e04fcbc 100644 --- a/crypto/aead.c +++ b/crypto/aead.c @@ -107,7 +107,8 @@ static int old_crypt(struct aead_request *req, return crypt(req); src = scatterwalk_ffwd(nreq->srcbuf, req->src, req->assoclen); - dst = scatterwalk_ffwd(nreq->dstbuf, req->dst, req->assoclen); + dst = req->src == req->dst ? + src : scatterwalk_ffwd(nreq->dstbuf, req->dst, req->assoclen); aead_request_set_tfm(&nreq->subreq, aead); aead_request_set_callback(&nreq->subreq, aead_request_flags(req), |