Ver código fonte

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
Rajeev Kumar 8 anos atrás
pai
commit
cf7bd801e5

+ 1 - 1
core/hdd/src/wlan_hdd_ftm.c

@@ -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)
 {
-	struct scheduler_msg ftmMsg;
+	struct scheduler_msg ftmMsg = {0};
 
 	ENTER();
 

+ 1 - 1
core/mac/src/cfg/cfg_proc_msg.c

@@ -1733,7 +1733,7 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam
 	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"),

+ 1 - 1
core/mac/src/cfg/cfg_send_msg.c

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

+ 1 - 1
core/mac/src/pe/lim/lim_api.c

@@ -2356,7 +2356,7 @@ void lim_update_lost_link_info(tpAniSirGlobal mac, tpPESession session,
 				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,

+ 1 - 1
core/mac/src/pe/lim/lim_ft_preauth.c

@@ -603,7 +603,7 @@ void lim_post_ft_pre_auth_rsp(tpAniSirGlobal mac_ctx,
 			      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);

+ 1 - 1
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -417,7 +417,7 @@ lim_process_ext_channel_switch_action_frame(tpAniSirGlobal mac_ctx,
 	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) {

+ 4 - 5
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -452,7 +452,7 @@ __lim_pno_match_fwd_bcn_probepsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
 {
 	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 @@ __lim_ext_scan_forward_bcn_probe_rsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
 {
 	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 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx,
 	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_messages(tpAniSirGlobal mac_ctx,
 
 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;
 

+ 9 - 9
core/mac/src/pe/lim/lim_timer_utils.c

@@ -448,7 +448,7 @@ err_timer:
 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_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;
 
 	/* 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)
 {
-	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_auth_response_timer_handler(void *pMacGlobal, 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;
 	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)
 {
-	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_activate_auth_rsp_timer(tpAniSirGlobal pMac, tLimPreAuthNode *pAuthNode
 
 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_cnf_wait_tmer_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;
 
 	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)
 {
-	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_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;
 
 	msg.type = SIR_LIM_QUIET_BSS_TIMEOUT;

+ 2 - 2
core/mac/src/pe/lim/lim_types.h

@@ -676,7 +676,7 @@ tSirRetStatus lim_send_sa_query_response_frame(tpAniSirGlobal pMac,
 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 @@ static inline void
 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;

+ 2 - 2
core/mac/src/pe/rrm/rrm_api.c

@@ -353,7 +353,7 @@ rrm_process_neighbor_report_response(tpAniSirGlobal pMac,
 	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 @@ rrm_process_beacon_report_req(tpAniSirGlobal pMac,
 			      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;

+ 2 - 2
core/mac/src/sys/common/src/wlan_qct_sys.c

@@ -94,7 +94,7 @@ static void sys_stop_complete_cb(void *pUserData)
 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 sys_process_mmh_msg(tpAniSirGlobal pMac, struct scheduler_msg *pMsg)
  */
 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;

+ 3 - 3
core/wma/src/wma_data.c

@@ -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,
 					    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 @@ void ol_rx_err(void *pdev, uint8_t vdev_id,
 	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 @@ wma_indicate_err(
 	{
 		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) {

+ 3 - 3
core/wma/src/wma_features.c

@@ -1041,7 +1041,7 @@ int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf,
 	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 @@ static void wma_send_status_of_ext_wow(tp_wma_handle wma, bool status)
 {
 	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 @@ 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)
 {
-	struct scheduler_msg resume_msg;
+	struct scheduler_msg resume_msg = {0};
 	QDF_STATUS status;
 	tp_wma_handle wma = (tp_wma_handle) handle;
 

+ 1 - 1
core/wma/src/wma_nan_datapath.c

@@ -668,7 +668,7 @@ static int wma_ndp_end_indication_event_handler(void *handle,
 	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;

+ 2 - 2
core/wma/src/wma_scan_roam.c

@@ -1869,7 +1869,7 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle,
 
 		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 @@ 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)
 {
-	struct scheduler_msg cds_msg;
+	struct scheduler_msg cds_msg = {0};
 	tSirSmeCandidateFoundInd *candidate_ind;
 	struct scan_param *params;
 

+ 2 - 2
core/wma/src/wma_utils.c

@@ -436,7 +436,7 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
 	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_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)
 {
 	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));