qcacld-3.0: Initialize scheduler_msg on stack before posting message
Initialize scheduler_msg on stack before posting using scheduler API
such that un-used fields in message structure are initialized to 0.
Change-Id: I1f46416f15c1b81273e1b32798937c05bcf176a9
CRs-Fixed: 2034770
diff --git a/core/hdd/src/wlan_hdd_ftm.c b/core/hdd/src/wlan_hdd_ftm.c
index c3e0354..4546e60 100644
--- a/core/hdd/src/wlan_hdd_ftm.c
+++ b/core/hdd/src/wlan_hdd_ftm.c
@@ -90,7 +90,7 @@
*/
static uint32_t wlan_ftm_postmsg(uint8_t *cmd_ptr, uint16_t cmd_len)
{
- struct scheduler_msg ftmMsg;
+ struct scheduler_msg ftmMsg = {0};
ENTER();
diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c
index a337f0f..b7fd9dd 100644
--- a/core/mac/src/cfg/cfg_proc_msg.c
+++ b/core/mac/src/cfg/cfg_proc_msg.c
@@ -1733,7 +1733,7 @@
uint32_t strSize, j;
uint8_t pStr[CFG_MAX_STR_LEN];
tpCfgBinHdr pHdr;
- struct scheduler_msg mmhMsg;
+ struct scheduler_msg mmhMsg = {0};
/* First Dword must contain the AP or STA magic dword */
PELOGW(cfg_log(pMac, LOGW, FL("CFG size %d bytes MAGIC dword is 0x%x"),
diff --git a/core/mac/src/cfg/cfg_send_msg.c b/core/mac/src/cfg/cfg_send_msg.c
index 4c2dbfe..2a17a47 100644
--- a/core/mac/src/cfg/cfg_send_msg.c
+++ b/core/mac/src/cfg/cfg_send_msg.c
@@ -74,7 +74,7 @@
uint32_t *pData)
{
uint32_t *pMsg, *pEnd;
- struct scheduler_msg mmhMsg;
+ struct scheduler_msg mmhMsg = {0};
/* sanity */
if ((paramNum > 0) && (NULL == pParamList)) {
diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c
index b5730d1..258d712 100644
--- a/core/mac/src/pe/lim/lim_api.c
+++ b/core/mac/src/pe/lim/lim_api.c
@@ -2356,7 +2356,7 @@
int32_t rssi)
{
struct sir_lost_link_info *lost_link_info;
- struct scheduler_msg mmh_msg;
+ struct scheduler_msg mmh_msg = {0};
if ((NULL == mac) || (NULL == session)) {
QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
diff --git a/core/mac/src/pe/lim/lim_ft_preauth.c b/core/mac/src/pe/lim/lim_ft_preauth.c
index 0d1f4cb..d187e2e 100644
--- a/core/mac/src/pe/lim/lim_ft_preauth.c
+++ b/core/mac/src/pe/lim/lim_ft_preauth.c
@@ -603,7 +603,7 @@
tpPESession session)
{
tpSirFTPreAuthRsp ft_pre_auth_rsp;
- struct scheduler_msg mmh_msg;
+ struct scheduler_msg mmh_msg = {0};
uint16_t rsp_len = sizeof(tSirFTPreAuthRsp);
ft_pre_auth_rsp = (tpSirFTPreAuthRsp) qdf_mem_malloc(rsp_len);
diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c
index cff14d6..59ccbd3 100644
--- a/core/mac/src/pe/lim/lim_process_action_frame.c
+++ b/core/mac/src/pe/lim/lim_process_action_frame.c
@@ -417,7 +417,7 @@
if (eLIM_AP_ROLE == session_entry->limSystemRole) {
struct sir_sme_ext_cng_chan_ind *ext_cng_chan_ind;
- struct scheduler_msg mmh_msg;
+ struct scheduler_msg mmh_msg = {0};
ext_cng_chan_ind = qdf_mem_malloc(sizeof(*ext_cng_chan_ind));
if (NULL == ext_cng_chan_ind) {
diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c
index 92f35f2..148fdc7 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -452,7 +452,7 @@
{
struct pno_match_found *result;
uint8_t *body;
- struct scheduler_msg mmh_msg;
+ struct scheduler_msg mmh_msg = {0};
tpSirMacMgmtHdr hdr;
uint32_t num_results = 1, len, i;
@@ -510,7 +510,7 @@
{
tpSirWifiFullScanResultEvent result;
uint8_t *body;
- struct scheduler_msg mmh_msg;
+ struct scheduler_msg mmh_msg = {0};
tpSirMacMgmtHdr hdr;
uint32_t frame_len;
tSirBssDescription *bssdescr;
@@ -1248,7 +1248,7 @@
uint16_t pkt_len = 0;
cds_pkt_t *body_ptr = NULL;
QDF_STATUS qdf_status;
- struct scheduler_msg new_msg;
+ struct scheduler_msg new_msg = {0};
tSirSmeScanAbortReq *req_msg = NULL;
uint8_t session_id;
uint32_t scan_id;
@@ -1951,8 +1951,7 @@
static void lim_process_deferred_message_queue(tpAniSirGlobal pMac)
{
- struct scheduler_msg limMsg = { 0, 0, 0 };
-
+ struct scheduler_msg limMsg = {0};
struct scheduler_msg *readMsg;
uint16_t size;
diff --git a/core/mac/src/pe/lim/lim_timer_utils.c b/core/mac/src/pe/lim/lim_timer_utils.c
index 86dbcfa..d3c3acc 100644
--- a/core/mac/src/pe/lim/lim_timer_utils.c
+++ b/core/mac/src/pe/lim/lim_timer_utils.c
@@ -448,7 +448,7 @@
void lim_timer_handler(void *pMacGlobal, uint32_t param)
{
uint32_t statusCode;
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
/* Prepare and post message to LIM Message Queue */
@@ -487,7 +487,7 @@
void lim_addts_response_timer_handler(void *pMacGlobal, uint32_t param)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
/* Prepare and post message to LIM Message Queue */
@@ -522,7 +522,7 @@
void lim_auth_response_timer_handler(void *pMacGlobal, uint32_t param)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
/* Prepare and post message to LIM Message Queue */
@@ -548,7 +548,7 @@
*/
void lim_assoc_failure_timer_handler(void *mac_global, uint32_t param)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
tpAniSirGlobal mac_ctx = (tpAniSirGlobal) mac_global;
tpPESession session = NULL;
@@ -605,7 +605,7 @@
*/
void lim_update_olbc_cache_timer_handler(void *pMacGlobal, uint32_t param)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
/* Prepare and post message to LIM Message Queue */
@@ -1224,7 +1224,7 @@
void lim_cnf_wait_tmer_handler(void *pMacGlobal, uint32_t param)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
uint32_t statusCode;
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
@@ -1241,7 +1241,7 @@
void lim_channel_switch_timer_handler(void *pMacGlobal, uint32_t param)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
PELOG1(lim_log(pMac, LOG1,
@@ -1257,7 +1257,7 @@
void lim_quiet_timer_handler(void *pMacGlobal, uint32_t param)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
msg.type = SIR_LIM_QUIET_TIMEOUT;
@@ -1270,7 +1270,7 @@
void lim_quiet_bss_timer_handler(void *pMacGlobal, uint32_t param)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;
diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h
index daa7f0c..1ff6ae4 100644
--- a/core/mac/src/pe/lim/lim_types.h
+++ b/core/mac/src/pe/lim/lim_types.h
@@ -676,7 +676,7 @@
static inline void
lim_post_sme_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
if (pMsgBuf == NULL) {
lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));
@@ -724,7 +724,7 @@
lim_post_mlm_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf)
{
- struct scheduler_msg msg;
+ struct scheduler_msg msg = {0};
if (pMsgBuf == NULL) {
lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));
return;
diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c
index 789079b..d7eb2b4 100644
--- a/core/mac/src/pe/rrm/rrm_api.c
+++ b/core/mac/src/pe/rrm/rrm_api.c
@@ -353,7 +353,7 @@
tpSirNeighborReportInd pSmeNeighborRpt = NULL;
uint16_t length;
uint8_t i;
- struct scheduler_msg mmhMsg;
+ struct scheduler_msg mmhMsg = {0};
if (pNeighborRep == NULL || pSessionEntry == NULL) {
PELOGE(lim_log(pMac, LOGE, FL(" Invalid parameters"));)
@@ -536,7 +536,7 @@
tDot11fIEMeasurementRequest *pBeaconReq,
tpPESession pSessionEntry)
{
- struct scheduler_msg mmhMsg;
+ struct scheduler_msg mmhMsg = {0};
tpSirBeaconReportReqInd pSmeBcnReportReq;
uint8_t num_channels = 0, num_APChanReport;
uint16_t measDuration, maxMeasduration;
diff --git a/core/mac/src/sys/common/src/wlan_qct_sys.c b/core/mac/src/sys/common/src/wlan_qct_sys.c
index 35c8a9f..f2e6bf4 100644
--- a/core/mac/src/sys/common/src/wlan_qct_sys.c
+++ b/core/mac/src/sys/common/src/wlan_qct_sys.c
@@ -94,7 +94,7 @@
QDF_STATUS sys_stop(v_CONTEXT_t p_cds_context)
{
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
- struct scheduler_msg sysMsg;
+ struct scheduler_msg sysMsg = {0};
/* Initialize the stop event */
qdf_status = qdf_event_create(&g_stop_evt);
@@ -366,7 +366,7 @@
*/
void wlan_sys_probe(void)
{
- struct scheduler_msg message;
+ struct scheduler_msg message = {0};
message.reserved = SYS_MSG_COOKIE;
message.type = SYS_MSG_ID_MC_THR_PROBE;
diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c
index 3fe605c..c44ce1a 100644
--- a/core/wma/src/wma_data.c
+++ b/core/wma/src/wma_data.c
@@ -2155,7 +2155,7 @@
int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
uint32_t len)
{
- struct scheduler_msg cds_msg;
+ struct scheduler_msg cds_msg = {0};
wmi_peer_info *peer_info;
void *pdev;
tSirIbssPeerInfoParams *pSmeRsp;
@@ -2930,7 +2930,7 @@
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
tpSirSmeMicFailureInd mic_err_ind;
struct ether_header *eth_hdr;
- struct scheduler_msg cds_msg;
+ struct scheduler_msg cds_msg = {0};
if (NULL == wma) {
WMA_LOGE("%s: Failed to get wma", __func__);
@@ -3080,7 +3080,7 @@
{
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
tpSirSmeMicFailureInd mic_err_ind;
- struct scheduler_msg cds_msg;
+ struct scheduler_msg cds_msg = {0};
uint8_t vdev_id;
if (NULL == wma) {
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c
index e89b793..aeafeb5 100644
--- a/core/wma/src/wma_features.c
+++ b/core/wma/src/wma_features.c
@@ -1041,7 +1041,7 @@
tSirNanEvent *nan_rsp_event;
wmi_nan_event_hdr *nan_rsp_event_hdr;
QDF_STATUS status;
- struct scheduler_msg message;
+ struct scheduler_msg message = {0};
uint8_t *buf_ptr;
uint32_t alloc_len;
@@ -3970,7 +3970,7 @@
{
tSirReadyToExtWoWInd *ready_to_extwow;
QDF_STATUS vstatus;
- struct scheduler_msg message;
+ struct scheduler_msg message = {0};
uint8_t len;
WMA_LOGD("Posting ready to suspend indication to umac");
@@ -4454,7 +4454,7 @@
*/
static QDF_STATUS wma_post_runtime_resume_msg(WMA_HANDLE handle)
{
- struct scheduler_msg resume_msg;
+ struct scheduler_msg resume_msg = {0};
QDF_STATUS status;
tp_wma_handle wma = (tp_wma_handle) handle;
diff --git a/core/wma/src/wma_nan_datapath.c b/core/wma/src/wma_nan_datapath.c
index 6f73040..dfd879c 100644
--- a/core/wma/src/wma_nan_datapath.c
+++ b/core/wma/src/wma_nan_datapath.c
@@ -668,7 +668,7 @@
tp_wma_handle wma_handle = handle;
WMI_NDP_END_INDICATION_EVENTID_param_tlvs *event;
wmi_ndp_end_indication *ind;
- struct scheduler_msg pe_msg;
+ struct scheduler_msg pe_msg = {0};
struct ndp_end_indication_event *ndp_event_buf;
int i, ret, buf_size;
struct qdf_mac_addr peer_addr;
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 4b51bdd..9fc55f8 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -1869,7 +1869,7 @@
if (roam_req->reason ==
REASON_OS_REQUESTED_ROAMING_NOW) {
- struct scheduler_msg cds_msg;
+ struct scheduler_msg cds_msg = {0};
tSirRoamOffloadScanRsp *scan_offload_rsp;
scan_offload_rsp =
qdf_mem_malloc(sizeof(*scan_offload_rsp));
@@ -5314,7 +5314,7 @@
*/
void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id)
{
- struct scheduler_msg cds_msg;
+ struct scheduler_msg cds_msg = {0};
tSirSmeCandidateFoundInd *candidate_ind;
struct scan_param *params;
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index 851f799..21bc5c0 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -436,7 +436,7 @@
tSirStatsExtEvent *stats_ext_event;
wmi_stats_ext_event_fixed_param *stats_ext_info;
QDF_STATUS status;
- struct scheduler_msg cds_msg;
+ struct scheduler_msg cds_msg = {0};
uint8_t *buf_ptr;
uint32_t alloc_len;
@@ -1750,7 +1750,7 @@
int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event)
{
struct rso_cmd_status *rso_status;
- struct scheduler_msg sme_msg;
+ struct scheduler_msg sme_msg = {0};
QDF_STATUS qdf_status;
rso_status = qdf_mem_malloc(sizeof(*rso_status));