From: Herbert Xu Date: Mon, 11 May 2015 09:48:01 +0000 (+0800) Subject: crypto: pcrypt - Use crypto_aead_set_reqsize helper X-Git-Tag: v4.1.12-92~24^2~91 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=55dbcd9a3215aee911e72fd44d10fa60ff293ca7;p=users%2Fjedix%2Flinux-maple.git crypto: pcrypt - Use crypto_aead_set_reqsize helper This patch uses the crypto_aead_set_reqsize helper to avoid directly touching the internals of aead. Signed-off-by: Herbert Xu (cherry picked from commit fd0de97890d88b979c2731bd5b70d504175fc2ed) Orabug: 24614549 Signed-off-by: Ethan Zhao Signed-off-by: Dhaval Giani --- diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c index c305d4112735c..ac115d591d66e 100644 --- a/crypto/pcrypt.c +++ b/crypto/pcrypt.c @@ -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; }