Skip to contentSkip to conversation

crypto: aspeed: fix uninitialized symbol 'idx' warning

PATCH In review Neal Liu 2 participants 2 messages Mar 1, 2023 – Mar 10, 2023

Subsystems (3)
lore
Share & tools
lore

Neal Liu

author maintainer
#0 lore raw

PATCH 1/1 crypto: aspeed: fix uninitialized symbol 'idx' warning

'idx' is not initialized if it's not EXP_MODE nor MOD_MODE. Use "else" instead to fix it.

---
 drivers/crypto/aspeed/aspeed-acry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/aspeed/aspeed-acry.c +1 -1
index 1f77ebd73489..828dc3ae1b5f 100644
@@ -289,7 +289,7 @@ static int aspeed_acry_rsa_ctx_copy(struct aspeed_acry_dev *acry_dev, void *buf,
 
 			if (mode == ASPEED_RSA_EXP_MODE)
 				idx = acry_dev->exp_dw_mapping[j - 1];
-			else if (mode == ASPEED_RSA_MOD_MODE)
+			else /* mode == ASPEED_RSA_MOD_MODE */
 				idx = acry_dev->mod_dw_mapping[j - 1];
 
 			dw_buf[idx] = cpu_to_le32(data);
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 11 lines · Neal Liu

'idx' is not initialized if it's not EXP_MODE nor MOD_MODE. Use "else" instead to fix it.

---
 drivers/crypto/aspeed/aspeed-acry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt