On 5/31/23 11:37, Robin Jarry wrote:
> GCC now reports uninitialized warnings from function return values.
> 
> ../lib/netdev-dpdk.c: In function 'netdev_dpdk_mempool_configure':
> ../lib/netdev-dpdk.c:964:22: warning: 'dmp' may be used uninitialized 
> [-Wmaybe-uninitialized]
>   964 |         dev->dpdk_mp = dmp;
>       |         ~~~~~~~~~~~~~^~~~~
> ../lib/netdev-dpdk.c:854:21: note: 'dmp' was declared here
>   854 |     struct dpdk_mp *dmp, *next;
>       |                     ^~~
> 
> NB: this looks like a false positive, gcc 13 probably fails to see the link
> between reuse and dmp in dpdk_mp_get().
> 
> Signed-off-by: Robin Jarry <rja...@redhat.com>
> Reviewed-by: David Marchand <david.march...@redhat.com>
> ---
> 
> Notes:
>     v2: Fixed commit title and added note about possible false positive.
> 
>  lib/netdev-dpdk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index fb0dd43f75c5..e11508cd5c31 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -840,7 +840,7 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu)
>  static struct dpdk_mp *
>  dpdk_mp_get(struct netdev_dpdk *dev, int mtu)
>  {
> -    struct dpdk_mp *dmp, *next;
> +    struct dpdk_mp *dmp = NULL, *next;
>      bool reuse = false;
>  
>      ovs_mutex_lock(&dpdk_mp_mutex);


Yeah, this definitely looks like a false-positive.  But I can reproduce
the warning and this patch is fixing it.  So, applied to branches down
to 2.17.  Thanks!

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to