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
This commit is contained in:
Rajeev Kumar
2017-04-18 11:11:42 -07:00
committed by Sandeep Puligilla
parent 04980d268c
commit cf7bd801e5
16 changed files with 36 additions and 37 deletions

View File

@@ -90,7 +90,7 @@ static void wlanqcmbr_mc_process_msg(void *message);
*/ */
static uint32_t wlan_ftm_postmsg(uint8_t *cmd_ptr, uint16_t cmd_len) static uint32_t wlan_ftm_postmsg(uint8_t *cmd_ptr, uint16_t cmd_len)
{ {
struct scheduler_msg ftmMsg; struct scheduler_msg ftmMsg = {0};
ENTER(); ENTER();

View File

@@ -1733,7 +1733,7 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam
uint32_t strSize, j; uint32_t strSize, j;
uint8_t pStr[CFG_MAX_STR_LEN]; uint8_t pStr[CFG_MAX_STR_LEN];
tpCfgBinHdr pHdr; tpCfgBinHdr pHdr;
struct scheduler_msg mmhMsg; struct scheduler_msg mmhMsg = {0};
/* First Dword must contain the AP or STA magic dword */ /* 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"), PELOGW(cfg_log(pMac, LOGW, FL("CFG size %d bytes MAGIC dword is 0x%x"),

View File

@@ -74,7 +74,7 @@ cfg_send_host_msg(tpAniSirGlobal pMac, uint16_t msgType, uint32_t msgLen,
uint32_t *pData) uint32_t *pData)
{ {
uint32_t *pMsg, *pEnd; uint32_t *pMsg, *pEnd;
struct scheduler_msg mmhMsg; struct scheduler_msg mmhMsg = {0};
/* sanity */ /* sanity */
if ((paramNum > 0) && (NULL == pParamList)) { if ((paramNum > 0) && (NULL == pParamList)) {

View File

@@ -2356,7 +2356,7 @@ void lim_update_lost_link_info(tpAniSirGlobal mac, tpPESession session,
int32_t rssi) int32_t rssi)
{ {
struct sir_lost_link_info *lost_link_info; struct sir_lost_link_info *lost_link_info;
struct scheduler_msg mmh_msg; struct scheduler_msg mmh_msg = {0};
if ((NULL == mac) || (NULL == session)) { if ((NULL == mac) || (NULL == session)) {
QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR, QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,

View File

@@ -603,7 +603,7 @@ void lim_post_ft_pre_auth_rsp(tpAniSirGlobal mac_ctx,
tpPESession session) tpPESession session)
{ {
tpSirFTPreAuthRsp ft_pre_auth_rsp; tpSirFTPreAuthRsp ft_pre_auth_rsp;
struct scheduler_msg mmh_msg; struct scheduler_msg mmh_msg = {0};
uint16_t rsp_len = sizeof(tSirFTPreAuthRsp); uint16_t rsp_len = sizeof(tSirFTPreAuthRsp);
ft_pre_auth_rsp = (tpSirFTPreAuthRsp) qdf_mem_malloc(rsp_len); ft_pre_auth_rsp = (tpSirFTPreAuthRsp) qdf_mem_malloc(rsp_len);

View File

@@ -417,7 +417,7 @@ lim_process_ext_channel_switch_action_frame(tpAniSirGlobal mac_ctx,
if (eLIM_AP_ROLE == session_entry->limSystemRole) { if (eLIM_AP_ROLE == session_entry->limSystemRole) {
struct sir_sme_ext_cng_chan_ind *ext_cng_chan_ind; 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)); ext_cng_chan_ind = qdf_mem_malloc(sizeof(*ext_cng_chan_ind));
if (NULL == ext_cng_chan_ind) { if (NULL == ext_cng_chan_ind) {

View File

@@ -452,7 +452,7 @@ __lim_pno_match_fwd_bcn_probepsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
{ {
struct pno_match_found *result; struct pno_match_found *result;
uint8_t *body; uint8_t *body;
struct scheduler_msg mmh_msg; struct scheduler_msg mmh_msg = {0};
tpSirMacMgmtHdr hdr; tpSirMacMgmtHdr hdr;
uint32_t num_results = 1, len, i; uint32_t num_results = 1, len, i;
@@ -510,7 +510,7 @@ __lim_ext_scan_forward_bcn_probe_rsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
{ {
tpSirWifiFullScanResultEvent result; tpSirWifiFullScanResultEvent result;
uint8_t *body; uint8_t *body;
struct scheduler_msg mmh_msg; struct scheduler_msg mmh_msg = {0};
tpSirMacMgmtHdr hdr; tpSirMacMgmtHdr hdr;
uint32_t frame_len; uint32_t frame_len;
tSirBssDescription *bssdescr; tSirBssDescription *bssdescr;
@@ -1248,7 +1248,7 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx,
uint16_t pkt_len = 0; uint16_t pkt_len = 0;
cds_pkt_t *body_ptr = NULL; cds_pkt_t *body_ptr = NULL;
QDF_STATUS qdf_status; QDF_STATUS qdf_status;
struct scheduler_msg new_msg; struct scheduler_msg new_msg = {0};
tSirSmeScanAbortReq *req_msg = NULL; tSirSmeScanAbortReq *req_msg = NULL;
uint8_t session_id; uint8_t session_id;
uint32_t scan_id; uint32_t scan_id;
@@ -1951,8 +1951,7 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx,
static void lim_process_deferred_message_queue(tpAniSirGlobal pMac) 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; struct scheduler_msg *readMsg;
uint16_t size; uint16_t size;

View File

@@ -448,7 +448,7 @@ err_timer:
void lim_timer_handler(void *pMacGlobal, uint32_t param) void lim_timer_handler(void *pMacGlobal, uint32_t param)
{ {
uint32_t statusCode; uint32_t statusCode;
struct scheduler_msg msg; struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
/* Prepare and post message to LIM Message Queue */ /* Prepare and post message to LIM Message Queue */
@@ -487,7 +487,7 @@ void lim_timer_handler(void *pMacGlobal, uint32_t param)
void lim_addts_response_timer_handler(void *pMacGlobal, uint32_t param) void lim_addts_response_timer_handler(void *pMacGlobal, uint32_t param)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
/* Prepare and post message to LIM Message Queue */ /* Prepare and post message to LIM Message Queue */
@@ -522,7 +522,7 @@ void lim_addts_response_timer_handler(void *pMacGlobal, uint32_t param)
void lim_auth_response_timer_handler(void *pMacGlobal, uint32_t param) void lim_auth_response_timer_handler(void *pMacGlobal, uint32_t param)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
/* Prepare and post message to LIM Message Queue */ /* Prepare and post message to LIM Message Queue */
@@ -548,7 +548,7 @@ void lim_auth_response_timer_handler(void *pMacGlobal, uint32_t param)
*/ */
void lim_assoc_failure_timer_handler(void *mac_global, uint32_t param) 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; tpAniSirGlobal mac_ctx = (tpAniSirGlobal) mac_global;
tpPESession session = NULL; tpPESession session = NULL;
@@ -605,7 +605,7 @@ void lim_assoc_failure_timer_handler(void *mac_global, uint32_t param)
*/ */
void lim_update_olbc_cache_timer_handler(void *pMacGlobal, uint32_t param) 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; tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
/* Prepare and post message to LIM Message Queue */ /* Prepare and post message to LIM Message Queue */
@@ -1224,7 +1224,7 @@ void lim_activate_auth_rsp_timer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode
void lim_cnf_wait_tmer_handler(void *pMacGlobal, uint32_t param) void lim_cnf_wait_tmer_handler(void *pMacGlobal, uint32_t param)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
uint32_t statusCode; uint32_t statusCode;
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
@@ -1241,7 +1241,7 @@ void lim_cnf_wait_tmer_handler(void *pMacGlobal, uint32_t param)
void lim_channel_switch_timer_handler(void *pMacGlobal, uint32_t param) void lim_channel_switch_timer_handler(void *pMacGlobal, uint32_t param)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
PELOG1(lim_log(pMac, LOG1, PELOG1(lim_log(pMac, LOG1,
@@ -1257,7 +1257,7 @@ void lim_channel_switch_timer_handler(void *pMacGlobal, uint32_t param)
void lim_quiet_timer_handler(void *pMacGlobal, uint32_t param) void lim_quiet_timer_handler(void *pMacGlobal, uint32_t param)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
msg.type = SIR_LIM_QUIET_TIMEOUT; msg.type = SIR_LIM_QUIET_TIMEOUT;
@@ -1270,7 +1270,7 @@ void lim_quiet_timer_handler(void *pMacGlobal, uint32_t param)
void lim_quiet_bss_timer_handler(void *pMacGlobal, uint32_t param) void lim_quiet_bss_timer_handler(void *pMacGlobal, uint32_t param)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal; tpAniSirGlobal pMac = (tpAniSirGlobal) pMacGlobal;
msg.type = SIR_LIM_QUIET_BSS_TIMEOUT; msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;

View File

@@ -676,7 +676,7 @@ tSirRetStatus lim_send_sa_query_response_frame(tpAniSirGlobal pMac,
static inline void static inline void
lim_post_sme_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf) lim_post_sme_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
if (pMsgBuf == NULL) { if (pMsgBuf == NULL) {
lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL")); lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));
@@ -724,7 +724,7 @@ static inline void
lim_post_mlm_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf) lim_post_mlm_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
if (pMsgBuf == NULL) { if (pMsgBuf == NULL) {
lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL")); lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));
return; return;

View File

@@ -353,7 +353,7 @@ rrm_process_neighbor_report_response(tpAniSirGlobal pMac,
tpSirNeighborReportInd pSmeNeighborRpt = NULL; tpSirNeighborReportInd pSmeNeighborRpt = NULL;
uint16_t length; uint16_t length;
uint8_t i; uint8_t i;
struct scheduler_msg mmhMsg; struct scheduler_msg mmhMsg = {0};
if (pNeighborRep == NULL || pSessionEntry == NULL) { if (pNeighborRep == NULL || pSessionEntry == NULL) {
PELOGE(lim_log(pMac, LOGE, FL(" Invalid parameters"));) PELOGE(lim_log(pMac, LOGE, FL(" Invalid parameters"));)
@@ -536,7 +536,7 @@ rrm_process_beacon_report_req(tpAniSirGlobal pMac,
tDot11fIEMeasurementRequest *pBeaconReq, tDot11fIEMeasurementRequest *pBeaconReq,
tpPESession pSessionEntry) tpPESession pSessionEntry)
{ {
struct scheduler_msg mmhMsg; struct scheduler_msg mmhMsg = {0};
tpSirBeaconReportReqInd pSmeBcnReportReq; tpSirBeaconReportReqInd pSmeBcnReportReq;
uint8_t num_channels = 0, num_APChanReport; uint8_t num_channels = 0, num_APChanReport;
uint16_t measDuration, maxMeasduration; uint16_t measDuration, maxMeasduration;

View File

@@ -94,7 +94,7 @@ static void sys_stop_complete_cb(void *pUserData)
QDF_STATUS sys_stop(v_CONTEXT_t p_cds_context) QDF_STATUS sys_stop(v_CONTEXT_t p_cds_context)
{ {
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
struct scheduler_msg sysMsg; struct scheduler_msg sysMsg = {0};
/* Initialize the stop event */ /* Initialize the stop event */
qdf_status = qdf_event_create(&g_stop_evt); qdf_status = qdf_event_create(&g_stop_evt);
@@ -366,7 +366,7 @@ void sys_process_mmh_msg(tpAniSirGlobal pMac, struct scheduler_msg *pMsg)
*/ */
void wlan_sys_probe(void) void wlan_sys_probe(void)
{ {
struct scheduler_msg message; struct scheduler_msg message = {0};
message.reserved = SYS_MSG_COOKIE; message.reserved = SYS_MSG_COOKIE;
message.type = SYS_MSG_ID_MC_THR_PROBE; message.type = SYS_MSG_ID_MC_THR_PROBE;

View File

@@ -2155,7 +2155,7 @@ int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data, int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
uint32_t len) uint32_t len)
{ {
struct scheduler_msg cds_msg; struct scheduler_msg cds_msg = {0};
wmi_peer_info *peer_info; wmi_peer_info *peer_info;
void *pdev; void *pdev;
tSirIbssPeerInfoParams *pSmeRsp; tSirIbssPeerInfoParams *pSmeRsp;
@@ -2930,7 +2930,7 @@ void ol_rx_err(void *pdev, uint8_t vdev_id,
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA); tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
tpSirSmeMicFailureInd mic_err_ind; tpSirSmeMicFailureInd mic_err_ind;
struct ether_header *eth_hdr; struct ether_header *eth_hdr;
struct scheduler_msg cds_msg; struct scheduler_msg cds_msg = {0};
if (NULL == wma) { if (NULL == wma) {
WMA_LOGE("%s: Failed to get wma", __func__); WMA_LOGE("%s: Failed to get wma", __func__);
@@ -3080,7 +3080,7 @@ wma_indicate_err(
{ {
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA); tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
tpSirSmeMicFailureInd mic_err_ind; tpSirSmeMicFailureInd mic_err_ind;
struct scheduler_msg cds_msg; struct scheduler_msg cds_msg = {0};
uint8_t vdev_id; uint8_t vdev_id;
if (NULL == wma) { if (NULL == wma) {

View File

@@ -1041,7 +1041,7 @@ int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf,
tSirNanEvent *nan_rsp_event; tSirNanEvent *nan_rsp_event;
wmi_nan_event_hdr *nan_rsp_event_hdr; wmi_nan_event_hdr *nan_rsp_event_hdr;
QDF_STATUS status; QDF_STATUS status;
struct scheduler_msg message; struct scheduler_msg message = {0};
uint8_t *buf_ptr; uint8_t *buf_ptr;
uint32_t alloc_len; uint32_t alloc_len;
@@ -3970,7 +3970,7 @@ static void wma_send_status_of_ext_wow(tp_wma_handle wma, bool status)
{ {
tSirReadyToExtWoWInd *ready_to_extwow; tSirReadyToExtWoWInd *ready_to_extwow;
QDF_STATUS vstatus; QDF_STATUS vstatus;
struct scheduler_msg message; struct scheduler_msg message = {0};
uint8_t len; uint8_t len;
WMA_LOGD("Posting ready to suspend indication to umac"); WMA_LOGD("Posting ready to suspend indication to umac");
@@ -4454,7 +4454,7 @@ void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
*/ */
static QDF_STATUS wma_post_runtime_resume_msg(WMA_HANDLE handle) 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; QDF_STATUS status;
tp_wma_handle wma = (tp_wma_handle) handle; tp_wma_handle wma = (tp_wma_handle) handle;

View File

@@ -668,7 +668,7 @@ static int wma_ndp_end_indication_event_handler(void *handle,
tp_wma_handle wma_handle = handle; tp_wma_handle wma_handle = handle;
WMI_NDP_END_INDICATION_EVENTID_param_tlvs *event; WMI_NDP_END_INDICATION_EVENTID_param_tlvs *event;
wmi_ndp_end_indication *ind; wmi_ndp_end_indication *ind;
struct scheduler_msg pe_msg; struct scheduler_msg pe_msg = {0};
struct ndp_end_indication_event *ndp_event_buf; struct ndp_end_indication_event *ndp_event_buf;
int i, ret, buf_size; int i, ret, buf_size;
struct qdf_mac_addr peer_addr; struct qdf_mac_addr peer_addr;

View File

@@ -1869,7 +1869,7 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle,
if (roam_req->reason == if (roam_req->reason ==
REASON_OS_REQUESTED_ROAMING_NOW) { REASON_OS_REQUESTED_ROAMING_NOW) {
struct scheduler_msg cds_msg; struct scheduler_msg cds_msg = {0};
tSirRoamOffloadScanRsp *scan_offload_rsp; tSirRoamOffloadScanRsp *scan_offload_rsp;
scan_offload_rsp = scan_offload_rsp =
qdf_mem_malloc(sizeof(*scan_offload_rsp)); qdf_mem_malloc(sizeof(*scan_offload_rsp));
@@ -5314,7 +5314,7 @@ int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data,
*/ */
void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id) 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; tSirSmeCandidateFoundInd *candidate_ind;
struct scan_param *params; struct scan_param *params;

View File

@@ -436,7 +436,7 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
tSirStatsExtEvent *stats_ext_event; tSirStatsExtEvent *stats_ext_event;
wmi_stats_ext_event_fixed_param *stats_ext_info; wmi_stats_ext_event_fixed_param *stats_ext_info;
QDF_STATUS status; QDF_STATUS status;
struct scheduler_msg cds_msg; struct scheduler_msg cds_msg = {0};
uint8_t *buf_ptr; uint8_t *buf_ptr;
uint32_t alloc_len; uint32_t alloc_len;
@@ -1750,7 +1750,7 @@ int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event) int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event)
{ {
struct rso_cmd_status *rso_status; struct rso_cmd_status *rso_status;
struct scheduler_msg sme_msg; struct scheduler_msg sme_msg = {0};
QDF_STATUS qdf_status; QDF_STATUS qdf_status;
rso_status = qdf_mem_malloc(sizeof(*rso_status)); rso_status = qdf_mem_malloc(sizeof(*rso_status));