rk: revert to v3.10
[firefly-linux-kernel-4.4.55.git] / crypto / authenc.c
index 528b00bc476995cdae1d75372169b123630daa37..ffce19de05cf958853dc0e13f7e3cf1efa30cd4f 100644 (file)
@@ -368,10 +368,9 @@ static void crypto_authenc_encrypt_done(struct crypto_async_request *req,
        if (!err) {
                struct crypto_aead *authenc = crypto_aead_reqtfm(areq);
                struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc);
-               struct authenc_request_ctx *areq_ctx = aead_request_ctx(areq);
-               struct ablkcipher_request *abreq = (void *)(areq_ctx->tail
-                                                           + ctx->reqoff);
-               u8 *iv = (u8 *)abreq - crypto_ablkcipher_ivsize(ctx->enc);
+               struct ablkcipher_request *abreq = aead_request_ctx(areq);
+               u8 *iv = (u8 *)(abreq + 1) +
+                        crypto_ablkcipher_reqsize(ctx->enc);
 
                err = crypto_authenc_genicv(areq, iv, 0);
        }