This error is seen in build of type "minsize":
drivers/crypto/mlx5/mlx5_crypto_gcm.c:704:20: error:
'total_len' may be used uninitialized [-Werror=maybe-uninitialized]
It looks to be a compiler issue because we return an error
if building the KLM list fails, before using total_len.
The variable is initialized to allow compiling with "minsize" option.
Fixes: b01095830734 ("crypto/mlx5: add GCM enqueue/dequeue operations")
Signed-off-by: Cheryl Bansal <[email protected]>
---
drivers/crypto/mlx5/mlx5_crypto_gcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/mlx5/mlx5_crypto_gcm.c
b/drivers/crypto/mlx5/mlx5_crypto_gcm.c
index 1a2600655a..e4c7baa718 100644
--- a/drivers/crypto/mlx5/mlx5_crypto_gcm.c
+++ b/drivers/crypto/mlx5/mlx5_crypto_gcm.c
@@ -680,7 +680,7 @@ mlx5_crypto_gcm_build_umr(struct mlx5_crypto_qp *qp,
struct mlx5_klm *iklm;
struct mlx5_klm *klm = &qp->klm_array[idx * priv->max_klm_num];
uint16_t klm_size, klm_align;
- uint32_t total_len;
+ uint32_t total_len = 0;
/* Build KLM base on the op. */
klm_size = mlx5_crypto_gcm_build_op_klm(qp, op, op_info, klm,
&total_len);
--
2.43.0