Commit c32f08d0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Herbert Xu

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: 06af76b4 ("crypto: spacc - Add SPAcc aead support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f036dd56
...@@ -808,7 +808,7 @@ static int spacc_aead_process(struct aead_request *req, u64 seq, int encrypt) ...@@ -808,7 +808,7 @@ static int spacc_aead_process(struct aead_request *req, u64 seq, int encrypt)
u32 dstoff; u32 dstoff;
int icvremove; int icvremove;
int ivaadsize; int ivaadsize;
int ptaadsize; int ptaadsize = 0;
int iv_to_context; int iv_to_context;
int spacc_proc_len; int spacc_proc_len;
u32 spacc_icv_offset = 0; u32 spacc_icv_offset = 0;
...@@ -959,8 +959,6 @@ static int spacc_aead_process(struct aead_request *req, u64 seq, int encrypt) ...@@ -959,8 +959,6 @@ static int spacc_aead_process(struct aead_request *req, u64 seq, int encrypt)
tctx->mode == CRYPTO_MODE_NULL) { tctx->mode == CRYPTO_MODE_NULL) {
if (req->cryptlen >= icvremove) if (req->cryptlen >= icvremove)
ptaadsize = req->cryptlen - icvremove; ptaadsize = req->cryptlen - icvremove;
} else {
ptaadsize = 0;
} }
/* Calculate and set the below, important parameters /* Calculate and set the below, important parameters
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment