net/avp: fix gcc 10 maybe-uninitialized warning
authorKevin Traynor <ktraynor@redhat.com>
Wed, 11 Mar 2020 11:32:59 +0000 (11:32 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 6 May 2020 09:18:36 +0000 (11:18 +0200)
commitec87d3b2c2451ce0fa71f53f64987c68a0b3423c
treee8c00348cf08557b0752b4b558175de76b5ac59a
parentcafe1242595d168d711cf62447191fe218b76773
net/avp: fix gcc 10 maybe-uninitialized warning

gcc 10.0.1 reports:

../drivers/net/avp/avp_ethdev.c: In function ‘avp_xmit_scattered_pkts’:
../drivers/net/avp/avp_ethdev.c:1791:24:
warning: ‘avp_bufs[count]’ may be used uninitialized in this function
 [-Wmaybe-uninitialized]
 1791 |   tx_bufs[i] = avp_bufs[count];
      |                ~~~~~~~~^~~~~~~
../drivers/net/avp/avp_ethdev.c:1791:24:
warning: ‘avp_bufs[count]’ may be used uninitialized in this function
 [-Wmaybe-uninitialized]

Fix by initializing the array.

Fixes: 295abce2d25b ("net/avp: add packet transmit functions")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Steven Webster <steven.webster@windriver.com>
drivers/net/avp/avp_ethdev.c