* [PATCH 19.11] efd: fix uninitialized structure
@ 2022-03-10 16:20 Pablo de Lara
2022-03-11 9:10 ` Christian Ehrhardt
0 siblings, 1 reply; 2+ messages in thread
From: Pablo de Lara @ 2022-03-10 16:20 UTC (permalink / raw)
To: stable, christian.ehrhardt; +Cc: Pablo de Lara, Yipeng Wang
[ upstream commit ecda2c40ac549f2ebd1e8be6bf0a96c4aba6bf36 ]
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: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
---
lib/librte_efd/rte_efd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c
index 3fd1f1c97b..4cbe5380d1 100644
--- a/lib/librte_efd/rte_efd.c
+++ b/lib/librte_efd/rte_efd.c
@@ -1161,7 +1161,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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 19.11] efd: fix uninitialized structure
2022-03-10 16:20 [PATCH 19.11] efd: fix uninitialized structure Pablo de Lara
@ 2022-03-11 9:10 ` Christian Ehrhardt
0 siblings, 0 replies; 2+ messages in thread
From: Christian Ehrhardt @ 2022-03-11 9:10 UTC (permalink / raw)
To: Pablo de Lara; +Cc: stable, Yipeng Wang
On Thu, Mar 10, 2022 at 5:20 PM Pablo de Lara
<pablo.de.lara.guarch@intel.com> wrote:
>
> [ upstream commit ecda2c40ac549f2ebd1e8be6bf0a96c4aba6bf36 ]
Hi Pablo,
with that patch applied several Distributions start to fail to build
19.11 due to
centos7/8
[ 94s] /home/abuild/rpmbuild/BUILD/dpdk-1646987223.0afaa4b41/lib/librte_efd/rte_efd.c:
In function 'rte_efd_update':
[ 94s] /home/abuild/rpmbuild/BUILD/dpdk-1646987223.0afaa4b41/lib/librte_efd/rte_efd.c:1164:9:
error: missing initializer for field 'lookup_table' of 'struct
efd_online_group_entry' [-Werror=missing-field-initializers]
[ 94s] struct efd_online_group_entry entry = {{0}};
[ 94s] ^
[ 94s] /home/abuild/rpmbuild/BUILD/dpdk-1646987223.0afaa4b41/lib/librte_efd/rte_efd.c:209:18:
note: 'lookup_table' declared here
[ 94s] efd_lookuptbl_t lookup_table[RTE_EFD_VALUE_NUM_BITS];
[ 94s] ^
[ 94s] /home/abuild/rpmbuild/BUILD/dpdk-1646987223.0afaa4b41/lib/librte_efd/rte_efd.c:
At top level:
[ 94s] cc1: error: unrecognized command line option
"-Wno-address-of-packed-member" [-Werror]
sles*
[ 106s] /home/abuild/rpmbuild/BUILD/dpdk-1646987223.0afaa4b41/lib/librte_efd/rte_efd.c:
In function 'rte_efd_update':
[ 107s] /home/abuild/rpmbuild/BUILD/dpdk-1646987223.0afaa4b41/lib/librte_efd/rte_efd.c:1164:9:
error: missing initializer for field 'lookup_table' of 'struct
efd_online_group_entry' [-Werror=missing-field-initializers]
[ 107s] struct efd_online_group_entry entry = {{0}};
[ 107s] ^
[ 107s] /home/abuild/rpmbuild/BUILD/dpdk-1646987223.0afaa4b41/lib/librte_efd/rte_efd.c:209:18:
note: 'lookup_table' declared here
[ 107s] efd_lookuptbl_t lookup_table[RTE_EFD_VALUE_NUM_BITS];
[ 107s] ^
[ 107s] /home/abuild/rpmbuild/BUILD/dpdk-1646987223.0afaa4b41/lib/librte_efd/rte_efd.c:
At top level:
[ 107s] cc1: error: unrecognized command line option
"-Wno-address-of-packed-member" [-Werror]
[ 107s] cc1: all warnings being treated as errors
...
Therefore I unapplied your change after trying it ...
> 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: stable@dpdk.org
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
> ---
> lib/librte_efd/rte_efd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c
> index 3fd1f1c97b..4cbe5380d1 100644
> --- a/lib/librte_efd/rte_efd.c
> +++ b/lib/librte_efd/rte_efd.c
> @@ -1161,7 +1161,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
>
--
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-11 9:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-10 16:20 [PATCH 19.11] efd: fix uninitialized structure Pablo de Lara
2022-03-11 9:10 ` Christian Ehrhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).