misc: fix the uninitialization error 74/34874/2
authorMohsin Kazmi <sykazmi@cisco.com>
Mon, 10 Jan 2022 15:32:35 +0000 (15:32 +0000)
committerDamjan Marion <dmarion@me.com>
Tue, 11 Jan 2022 11:32:34 +0000 (11:32 +0000)
Type: fix

| src/vppinfra/vector/toeplitz.c:69:9: error: ‘kv’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
| src/vppinfra/memcpy_x86_64.h:45:17: error: ‘*((void *)&key+16)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|    *(u8x16u *) d = *(u8x16u *) s;
|    ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
| src/vnet/gre/interface.c:356:20: note: ‘*((void *)&key+16)’ was declared here

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I71614da2821ebda5200a0cb9437a7aad0c42fbb2

src/vnet/gre/interface.c
src/vppinfra/vector/toeplitz.c

index 4a02aa7..bc78c60 100644 (file)
@@ -353,7 +353,7 @@ static walk_rc_t
 gre_tunnel_add_teib_walk (index_t nei, void *ctx)
 {
   gre_tunnel_t *t = ctx;
-  gre_tunnel_key_t key;
+  gre_tunnel_key_t key = {};
 
   gre_teib_mk_key (t, teib_entry_get (nei), &key);
   gre_tunnel_db_add (t, &key);
index b0140d5..fcc4b64 100644 (file)
@@ -66,7 +66,7 @@ void
 clib_toeplitz_hash_key_expand (u64 *matrixes, u8 *key, int size)
 {
   u64x8u *m = (u64x8u *) matrixes;
-  u64x2 kv, zero = {};
+  u64x2 kv = {}, zero = {};
 
   while (size >= 8)
     {