crypto: pcrypt - Use crypto_aead_set_reqsize helper
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 11 May 2015 09:48:01 +0000 (17:48 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 13 May 2015 02:31:41 +0000 (10:31 +0800)
This patch uses the crypto_aead_set_reqsize helper to avoid directly
touching the internals of aead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/pcrypt.c

index c305d4112735cd3b7b18b477299b534b8c0e1b77..ac115d591d66e117236dea02800e70ed25e9332e 100644 (file)
@@ -292,9 +292,10 @@ static int pcrypt_aead_init_tfm(struct crypto_tfm *tfm)
                return PTR_ERR(cipher);
 
        ctx->child = cipher;
-       tfm->crt_aead.reqsize = sizeof(struct pcrypt_request)
-               + sizeof(struct aead_givcrypt_request)
-               + crypto_aead_reqsize(cipher);
+       crypto_aead_set_reqsize(__crypto_aead_cast(tfm),
+               sizeof(struct pcrypt_request) +
+               sizeof(struct aead_givcrypt_request) +
+               crypto_aead_reqsize(cipher));
 
        return 0;
 }