net/cnxk: fix uninitialized scalar variable

Message ID 20220424161818.1680637-1-gmuthukrishn@marvell.com (mailing list archive)
State Not Applicable, archived
Delegated to: Jerin Jacob
Headers
Series net/cnxk: fix uninitialized scalar variable |

Checks

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

Commit Message

Gowrishankar Muthukrishnan April 24, 2022, 4:18 p.m. UTC
Fix uninitialized scalar variable reported in coverity scan.

Coverity issue: 371876, 371877
Fixes: 39dc567c195 ("net/cnxk: add Tx burst for CN9K")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 drivers/net/cnxk/cn9k_tx.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Jerin Jacob May 5, 2022, 8:37 a.m. UTC | #1
On Sun, Apr 24, 2022 at 9:48 PM Gowrishankar Muthukrishnan
<gmuthukrishn@marvell.com> wrote:
>
> Fix uninitialized scalar variable reported in coverity scan.
>
> Coverity issue: 371876, 371877
> Fixes: 39dc567c195 ("net/cnxk: add Tx burst for CN9K")
>
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>

Squashed similar patch
https://patchwork.dpdk.org/project/dpdk/patch/20220424162239.1680904-1-gmuthukrishn@marvell.com/

Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks


> ---
>  drivers/net/cnxk/cn9k_tx.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
> index f55cd4bdf2..a0611a67c9 100644
> --- a/drivers/net/cnxk/cn9k_tx.h
> +++ b/drivers/net/cnxk/cn9k_tx.h
> @@ -526,7 +526,7 @@ cn9k_nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t pkts,
>  {
>         struct cn9k_eth_txq *txq = tx_queue;
>         const rte_iova_t io_addr = txq->io_addr;
> -       uint64_t lso_tun_fmt, mark_fmt = 0;
> +       uint64_t lso_tun_fmt = 0, mark_fmt = 0;
>         void *lmt_addr = txq->lmt_addr;
>         uint8_t mark_flag = 0;
>         uint16_t i;
> @@ -574,7 +574,7 @@ cn9k_nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
>  {
>         struct cn9k_eth_txq *txq = tx_queue;
>         const rte_iova_t io_addr = txq->io_addr;
> -       uint64_t lso_tun_fmt, mark_fmt = 0;
> +       uint64_t lso_tun_fmt = 0, mark_fmt = 0;
>         void *lmt_addr = txq->lmt_addr;
>         uint8_t mark_flag = 0;
>         uint16_t segdw;
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
index f55cd4bdf2..a0611a67c9 100644
--- a/drivers/net/cnxk/cn9k_tx.h
+++ b/drivers/net/cnxk/cn9k_tx.h
@@ -526,7 +526,7 @@  cn9k_nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t pkts,
 {
 	struct cn9k_eth_txq *txq = tx_queue;
 	const rte_iova_t io_addr = txq->io_addr;
-	uint64_t lso_tun_fmt, mark_fmt = 0;
+	uint64_t lso_tun_fmt = 0, mark_fmt = 0;
 	void *lmt_addr = txq->lmt_addr;
 	uint8_t mark_flag = 0;
 	uint16_t i;
@@ -574,7 +574,7 @@  cn9k_nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
 {
 	struct cn9k_eth_txq *txq = tx_queue;
 	const rte_iova_t io_addr = txq->io_addr;
-	uint64_t lso_tun_fmt, mark_fmt = 0;
+	uint64_t lso_tun_fmt = 0, mark_fmt = 0;
 	void *lmt_addr = txq->lmt_addr;
 	uint8_t mark_flag = 0;
 	uint16_t segdw;