[v2,2/2] efd: fix uninitialized structure

Message ID 20220224155759.819460-2-pablo.de.lara.guarch@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/2] test/efd: fix size of constant |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-x86_64-compile-testing fail Testing issues
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

De Lara Guarch, Pablo Feb. 24, 2022, 3:57 p.m. UTC
  Coverity flags that both elements of efd_online_group_entry
are used uninitialized. This is OK because this structure
is initially used for starting values, so any value is OK.

Coverity ID: 375868
Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
Cc: pablo.de.lara.guarch@intel.com
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---

-v2: Fixed typo in commit message 

---
 lib/efd/rte_efd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Wang, Yipeng1 Feb. 24, 2022, 5:14 p.m. UTC | #1
> -----Original Message-----
> From: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Sent: Thursday, February 24, 2022 7:58 AM
> To: Wang, Yipeng1 <yipeng1.wang@intel.com>; Marohn, Byron
> <byron.marohn@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v2 2/2] efd: fix uninitialized structure
> 
> Coverity flags that both elements of efd_online_group_entry are used
> uninitialized. This is OK because this structure is initially used for starting
> values, so any value is OK.
> 
> Coverity ID: 375868
> Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
> Cc: pablo.de.lara.guarch@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
> 
> -v2: Fixed typo in commit message
> 
> ---
>  lib/efd/rte_efd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c index
> 560cd78961..86910e587c 100644
> --- a/lib/efd/rte_efd.c
> +++ b/lib/efd/rte_efd.c
> @@ -1162,7 +1162,7 @@ rte_efd_update(struct rte_efd_table * const table,
> const unsigned int socket_id,  {
>  	uint32_t chunk_id = 0, group_id = 0, bin_id = 0;
>  	uint8_t new_bin_choice = 0;
> -	struct efd_online_group_entry entry;
> +	struct efd_online_group_entry entry = {0};
> 
>  	int status = efd_compute_update(table, socket_id, key, value,
>  			&chunk_id, &group_id, &bin_id,
> --
> 2.25.1
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
  

Patch

diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
index 560cd78961..86910e587c 100644
--- a/lib/efd/rte_efd.c
+++ b/lib/efd/rte_efd.c
@@ -1162,7 +1162,7 @@  rte_efd_update(struct rte_efd_table * const table, const unsigned int socket_id,
 {
 	uint32_t chunk_id = 0, group_id = 0, bin_id = 0;
 	uint8_t new_bin_choice = 0;
-	struct efd_online_group_entry entry;
+	struct efd_online_group_entry entry = {0};
 
 	int status = efd_compute_update(table, socket_id, key, value,
 			&chunk_id, &group_id, &bin_id,