common/cnxk: fix build failure with rhel

Message ID 20221025172958.378-1-anoobj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series common/cnxk: fix build failure with rhel |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues
ci/iol-testing warning apply patch failure

Commit Message

Anoob Joseph Oct. 25, 2022, 5:29 p.m. UTC
  Fix compiler warning of uninitialized address.

Fixes: a7033a2fb2bf ("common/cnxk: support custom UDP port values")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 drivers/common/cnxk/cnxk_security.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--
2.25.1
  

Comments

Akhil Goyal Oct. 25, 2022, 6:13 p.m. UTC | #1
> Subject: [PATCH] common/cnxk: fix build failure with rhel
> 
> Fix compiler warning of uninitialized address.
> 
> Fixes: a7033a2fb2bf ("common/cnxk: support custom UDP port values")
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Squashed with original commit.
Thanks.
  

Patch

diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c
index 68ed0d08b4..85105472a1 100644
--- a/drivers/common/cnxk/cnxk_security.c
+++ b/drivers/common/cnxk/cnxk_security.c
@@ -1269,10 +1269,12 @@  cnxk_on_ipsec_outb_sa_create(struct rte_security_ipsec_xform *ipsec,
 	}

 	ip4 = (struct rte_ipv4_hdr *)&template->ip4.ipv4_hdr;
+
+	sport = 4500;
+	dport = 4500;
+
 	/* If custom port values are provided, Overwrite default port values. */
 	if (ipsec->options.udp_encap) {
-		sport = 4500;
-		dport = 4500;

 		if (ipsec->udp.sport)
 			sport = ipsec->udp.sport;