[qca-nss-ecm] Fix the conn sync many message request crash
Initialize the conn sync many message instance before
using its fields. When there is no connection in ECM
database, we just jump to the reschedule label, but
in that label this instance is used without initialized.
Change-Id: I247d41ed30c5f420d1efd9e63c801c8df48a977b
Signed-off-by: Murat Sezgin <msezgin@codeaurora.org>
diff --git a/frontends/nss/ecm_nss_ipv4.c b/frontends/nss/ecm_nss_ipv4.c
index 2da3d05..c985382 100644
--- a/frontends/nss/ecm_nss_ipv4.c
+++ b/frontends/nss/ecm_nss_ipv4.c
@@ -2067,15 +2067,13 @@
/*
* Prepare a nss_ipv4_msg with CONN_STATS_SYNC_MANY request
*/
- struct nss_ipv4_conn_sync_many_msg *nicsm_req;
+ struct nss_ipv4_conn_sync_many_msg *nicsm_req = &ecm_nss_ipv4_sync_req_msg->msg.conn_stats_many;
nss_tx_status_t nss_tx_status;
int retry = 3;
unsigned long int current_jiffies;
usleep_range(ECM_NSS_IPV4_STATS_SYNC_UDELAY - 100, ECM_NSS_IPV4_STATS_SYNC_UDELAY);
- nicsm_req = &ecm_nss_ipv4_sync_req_msg->msg.conn_stats_many;
-
/*
* If index is 0, we are starting a new round, but if we still have time remain
* in this round, sleep until it ends
diff --git a/frontends/nss/ecm_nss_ipv6.c b/frontends/nss/ecm_nss_ipv6.c
index ab79e20..6d02173 100644
--- a/frontends/nss/ecm_nss_ipv6.c
+++ b/frontends/nss/ecm_nss_ipv6.c
@@ -1726,15 +1726,13 @@
/*
* Prepare a nss_ipv6_msg with CONN_STATS_SYNC_MANY request
*/
- struct nss_ipv6_conn_sync_many_msg *nicsm_req;
+ struct nss_ipv6_conn_sync_many_msg *nicsm_req = &ecm_nss_ipv6_sync_req_msg->msg.conn_stats_many;;
nss_tx_status_t nss_tx_status;
int retry = 3;
unsigned long int current_jiffies;
usleep_range(ECM_NSS_IPV6_STATS_SYNC_UDELAY - 100, ECM_NSS_IPV6_STATS_SYNC_UDELAY);
- nicsm_req = &ecm_nss_ipv6_sync_req_msg->msg.conn_stats_many;
-
/*
* If index is 0, we are starting a new round, but if we still have time remain
* in this round, sleep until it ends