Skip to content

Commit

Permalink
crypto/zuc: fix build with GCC 11
Browse files Browse the repository at this point in the history
[ upstream commit 099db3d ]

GCC 11 complains that some arrays may be uninitialized in
process_zuc_hash_op(). This is because their initialization
depends on num_ops being > 0.

This function is only called with num_ops > 0 because of
checks in process_zuc_hash_op().

To remove the warning initialize the arrays.

Fixes: 0b133c3 ("crypto/zuc: support IPsec Multi-buffer lib v0.54")

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
  • Loading branch information
kevintraynor authored and steevenlee committed Jun 8, 2021
1 parent 87eec97 commit 6156da1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/crypto/zuc/rte_zuc_pmd.c
Expand Up @@ -238,11 +238,11 @@ process_zuc_hash_op(struct zuc_qp *qp, struct rte_crypto_op **ops,
{
unsigned int i;
uint8_t processed_ops = 0;
uint8_t *src[ZUC_MAX_BURST];
uint8_t *src[ZUC_MAX_BURST] = { 0 };
uint32_t *dst[ZUC_MAX_BURST];
uint32_t length_in_bits[ZUC_MAX_BURST];
uint8_t *iv[ZUC_MAX_BURST];
const void *hash_keys[ZUC_MAX_BURST];
uint32_t length_in_bits[ZUC_MAX_BURST] = { 0 };
uint8_t *iv[ZUC_MAX_BURST] = { 0 };
const void *hash_keys[ZUC_MAX_BURST] = { 0 };
struct zuc_session *sess;

for (i = 0; i < num_ops; i++) {
Expand Down

0 comments on commit 6156da1

Please sign in to comment.