qcacmn: 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: Ib3183b2c65eb9affd6610f4572c751c39a25fff7
CRs-Fixed: 2034772
This commit is contained in:
Rajeev Kumar
2017-04-17 17:00:41 -07:00
committed by Sandeep Puligilla
parent b83f9e70ea
commit afc63bc8af
5 changed files with 19 additions and 11 deletions

View File

@@ -196,6 +196,14 @@ QDF_STATUS scheduler_post_msg_by_priority(QDF_MODULE_ID qid,
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
if ((0 != pMsg->reserved) && (SYS_MSG_COOKIE != pMsg->reserved)) {
QDF_TRACE(QDF_MODULE_ID_SCHEDULER, QDF_TRACE_LEVEL_ERROR,
"%s: Un-initialized message pointer.. please initialize it",
__func__);
QDF_BUG(0);
return QDF_STATUS_E_FAILURE;
}
/* Target_If is a special message queue in phase 3 convergence beacause /* Target_If is a special message queue in phase 3 convergence beacause
* its used by both legacy WMA and as well as new UMAC components which * its used by both legacy WMA and as well as new UMAC components which
* directly populate callback handlers in message body. * directly populate callback handlers in message body.
@@ -516,7 +524,7 @@ QDF_STATUS scheduler_deregister_sys_legacy_handler(void)
void scheduler_mc_timer_callback(unsigned long data) void scheduler_mc_timer_callback(unsigned long data)
{ {
qdf_mc_timer_t *timer = (qdf_mc_timer_t *)data; qdf_mc_timer_t *timer = (qdf_mc_timer_t *)data;
struct scheduler_msg msg; struct scheduler_msg msg = {0};
QDF_STATUS status; QDF_STATUS status;
qdf_mc_timer_callback_t callback = NULL; qdf_mc_timer_callback_t callback = NULL;

View File

@@ -907,7 +907,7 @@ static int target_if_ndp_end_ind_handler(ol_scn_t scn, uint8_t *data,
{ {
int i, buf_size; int i, buf_size;
QDF_STATUS status; QDF_STATUS status;
struct scheduler_msg msg; struct scheduler_msg msg = {0};
wmi_ndp_end_indication *ind; wmi_ndp_end_indication *ind;
struct qdf_mac_addr peer_addr; struct qdf_mac_addr peer_addr;
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;

View File

@@ -297,7 +297,7 @@ static QDF_STATUS p2p_vdev_obj_destroy_notification(
static QDF_STATUS p2p_send_noa_to_pe(struct p2p_noa_info *noa_info) static QDF_STATUS p2p_send_noa_to_pe(struct p2p_noa_info *noa_info)
{ {
struct p2p_noa_attr *noa_attr; struct p2p_noa_attr *noa_attr;
struct scheduler_msg msg; struct scheduler_msg msg = {0};
if (!noa_info) { if (!noa_info) {
p2p_err("noa info is null"); p2p_err("noa info is null");

View File

@@ -127,7 +127,7 @@ QDF_STATUS tgt_p2p_mgmt_ota_comp_cb(void *context, qdf_nbuf_t buf,
struct p2p_tx_conf_event *tx_conf_event; struct p2p_tx_conf_event *tx_conf_event;
struct p2p_soc_priv_obj *p2p_soc_obj; struct p2p_soc_priv_obj *p2p_soc_obj;
struct tx_action_context *tx_ctx; struct tx_action_context *tx_ctx;
struct scheduler_msg msg; struct scheduler_msg msg = {0};
p2p_debug("context:%p, buf:%p, status:%d, tx complete params:%p", p2p_debug("context:%p, buf:%p, status:%d, tx complete params:%p",
context, buf, status, tx_compl_params); context, buf, status, tx_compl_params);
@@ -176,7 +176,7 @@ QDF_STATUS tgt_p2p_mgmt_frame_rx_cb(struct wlan_objmgr_psoc *psoc,
struct p2p_rx_mgmt_frame *rx_mgmt; struct p2p_rx_mgmt_frame *rx_mgmt;
struct p2p_rx_mgmt_event *rx_mgmt_event; struct p2p_rx_mgmt_event *rx_mgmt_event;
struct p2p_soc_priv_obj *p2p_soc_obj; struct p2p_soc_priv_obj *p2p_soc_obj;
struct scheduler_msg msg; struct scheduler_msg msg = {0};
struct wlan_frame_hdr *wh; struct wlan_frame_hdr *wh;
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
struct p2p_roc_context *roc_ctx; struct p2p_roc_context *roc_ctx;
@@ -257,7 +257,7 @@ QDF_STATUS tgt_p2p_noa_event_cb(struct wlan_objmgr_psoc *psoc,
struct p2p_noa_info *event_info) struct p2p_noa_info *event_info)
{ {
struct p2p_noa_event *noa_event; struct p2p_noa_event *noa_event;
struct scheduler_msg msg; struct scheduler_msg msg = {0};
struct p2p_soc_priv_obj *p2p_soc_obj; struct p2p_soc_priv_obj *p2p_soc_obj;
p2p_debug("soc:%p, event_info:%p", psoc, event_info); p2p_debug("soc:%p, event_info:%p", psoc, event_info);
@@ -304,7 +304,7 @@ QDF_STATUS tgt_p2p_lo_event_cb(struct wlan_objmgr_psoc *psoc,
struct p2p_lo_event *event_info) struct p2p_lo_event *event_info)
{ {
struct p2p_lo_stop_event *lo_stop_event; struct p2p_lo_stop_event *lo_stop_event;
struct scheduler_msg msg; struct scheduler_msg msg = {0};
struct p2p_soc_priv_obj *p2p_soc_obj; struct p2p_soc_priv_obj *p2p_soc_obj;
p2p_debug("soc:%p, event_info:%p", psoc, event_info); p2p_debug("soc:%p, event_info:%p", psoc, event_info);

View File

@@ -69,7 +69,7 @@ QDF_STATUS ucfg_p2p_psoc_stop(struct wlan_objmgr_psoc *soc)
QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc, QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc,
struct p2p_roc_req *roc_req, uint64_t *cookie) struct p2p_roc_req *roc_req, uint64_t *cookie)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
struct p2p_soc_priv_obj *p2p_soc_obj; struct p2p_soc_priv_obj *p2p_soc_obj;
struct p2p_roc_context *roc_ctx; struct p2p_roc_context *roc_ctx;
@@ -114,7 +114,7 @@ QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc,
QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc, QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc,
uint64_t cookie) uint64_t cookie)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
struct p2p_soc_priv_obj *p2p_soc_obj; struct p2p_soc_priv_obj *p2p_soc_obj;
struct cancel_roc_context *cancel_roc; struct cancel_roc_context *cancel_roc;
@@ -151,7 +151,7 @@ QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc,
QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc, QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
struct p2p_mgmt_tx *mgmt_frm, uint64_t *cookie) struct p2p_mgmt_tx *mgmt_frm, uint64_t *cookie)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
struct p2p_soc_priv_obj *p2p_soc_obj; struct p2p_soc_priv_obj *p2p_soc_obj;
struct tx_action_context *tx_action; struct tx_action_context *tx_action;
@@ -210,7 +210,7 @@ QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc, QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
uint64_t cookie) uint64_t cookie)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
struct p2p_soc_priv_obj *p2p_soc_obj; struct p2p_soc_priv_obj *p2p_soc_obj;
struct cancel_roc_context *cancel_tx; struct cancel_roc_context *cancel_tx;