diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2024-08-15 14:20:04 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2024-08-24 21:38:54 +0800 |
commit | c32f08d024e275059474b3c11c1fc2bc7f2de990 (patch) | |
tree | 2809689b1e55461f44da54fb05cb13107b6db094 /drivers/crypto | |
parent | f036dd566453176d4eafb9701ebd69e7e59d6707 (diff) | |
download | linux-c32f08d024e275059474b3c11c1fc2bc7f2de990.tar.gz linux-c32f08d024e275059474b3c11c1fc2bc7f2de990.tar.bz2 linux-c32f08d024e275059474b3c11c1fc2bc7f2de990.zip |
crypto: spacc - Fix uninitialized variable in spacc_aead_process()
Smatch complains that:
drivers/crypto/dwc-spacc/spacc_aead.c:1031 spacc_aead_process()
error: uninitialized symbol 'ptaadsize'.
This could happen if, for example, tctx->mode was CRYPTO_MODE_NULL and
req->cryptlen was less than icvremove.
Fixes: 06af76b46c78 ("crypto: spacc - Add SPAcc aead support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rwxr-xr-x | drivers/crypto/dwc-spacc/spacc_aead.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/crypto/dwc-spacc/spacc_aead.c b/drivers/crypto/dwc-spacc/spacc_aead.c index 3a617da9007d..abf5971e919d 100755 --- a/drivers/crypto/dwc-spacc/spacc_aead.c +++ b/drivers/crypto/dwc-spacc/spacc_aead.c @@ -808,7 +808,7 @@ static int spacc_aead_process(struct aead_request *req, u64 seq, int encrypt) u32 dstoff; int icvremove; int ivaadsize; - int ptaadsize; + int ptaadsize = 0; int iv_to_context; int spacc_proc_len; u32 spacc_icv_offset = 0; @@ -959,8 +959,6 @@ static int spacc_aead_process(struct aead_request *req, u64 seq, int encrypt) tctx->mode == CRYPTO_MODE_NULL) { if (req->cryptlen >= icvremove) ptaadsize = req->cryptlen - icvremove; - } else { - ptaadsize = 0; } /* Calculate and set the below, important parameters |