qcacld-3.0: Initialize local struct objects

Initialize struct cm_roam_values_copy to avoid using uninitialized
parameters in wlan_cm_roam_cfg_set_value().
Initialize struct pdev_params to zero to avoid using uninitialized
parameters in wmi_unified_pdev_param_send().

Change-Id: I820db09840431487f1756695a0562f8a794f549f
CRs-Fixed: 3187194
This commit is contained in:
Gangadhar Kavalastramath
2022-05-04 21:21:38 +05:30
committed by Madan Koyyalamudi
vanhempi 0227688bfd
commit 5062518762
10 muutettua tiedostoa jossa 28 lisäystä ja 28 poistoa

Näytä tiedosto

@@ -813,7 +813,7 @@ QDF_STATUS fwol_set_ilp_config(struct wlan_objmgr_pdev *pdev,
uint32_t enable_ilp)
{
QDF_STATUS status;
struct pdev_params pdev_param;
struct pdev_params pdev_param = {};
pdev_param.param_id = WMI_PDEV_PARAM_PCIE_HW_ILP;
pdev_param.param_value = enable_ilp;
@@ -846,7 +846,7 @@ QDF_STATUS fwol_configure_hw_assist(struct wlan_objmgr_pdev *pdev,
bool disable_hw_assist)
{
QDF_STATUS status;
struct pdev_params pdev_param;
struct pdev_params pdev_param = {};
pdev_param.param_id = WMI_PDEV_PARAM_DISABLE_HW_ASSIST;
pdev_param.param_value = disable_hw_assist;

Näytä tiedosto

@@ -4828,7 +4828,7 @@ bool cm_lookup_pmkid_using_bssid(struct wlan_objmgr_psoc *psoc,
void cm_roam_restore_default_config(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id)
{
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
struct wlan_objmgr_psoc *psoc;
struct wlan_mlme_psoc_ext_obj *mlme_obj;
@@ -5087,7 +5087,7 @@ static void cm_roam_start_init(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_pdev *pdev,
struct wlan_objmgr_vdev *vdev)
{
struct cm_roam_values_copy src_cfg;
struct cm_roam_values_copy src_cfg = {};
bool mdie_present;
uint8_t vdev_id = wlan_vdev_get_id(vdev);
struct wlan_mlme_psoc_ext_obj *mlme_obj;

Näytä tiedosto

@@ -1002,7 +1002,7 @@ QDF_STATUS cm_connect_start_ind(struct wlan_objmgr_vdev *vdev,
{
struct wlan_objmgr_psoc *psoc;
struct rso_config *rso_cfg;
struct cm_roam_values_copy src_cfg;
struct cm_roam_values_copy src_cfg = {};
if (!vdev || !req) {
mlme_err("vdev or req is NULL");

Näytä tiedosto

@@ -2080,7 +2080,7 @@ QDF_STATUS wlan_cm_set_roam_band_bitmask(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
uint32_t roam_band_bitmask)
{
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.uint_value = roam_band_bitmask;
return wlan_cm_roam_cfg_set_value(psoc, vdev_id, ROAM_BAND,

Näytä tiedosto

@@ -2962,7 +2962,7 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
tSirMacCapabilityInfo *ap_cap_info;
uint8_t wmm_mode, value;
struct wlan_mlme_lfr_cfg *lfr = &mac_ctx->mlme_cfg->lfr;
struct cm_roam_values_copy config;
struct cm_roam_values_copy config = {};
bool ese_ver_present;
int8_t reg_max;
struct ps_global_info *ps_global_info = &mac_ctx->sme.ps_global_info;

Näytä tiedosto

@@ -2580,7 +2580,7 @@ sme_process_twt_notify_event(struct mac_context *mac,
static void sme_link_lost_ind(struct mac_context *mac,
struct sir_lost_link_info *ind)
{
struct cm_roam_values_copy src_cfg;
struct cm_roam_values_copy src_cfg = {};
if (ind) {
src_cfg.int_value = ind->rssi;
@@ -5888,7 +5888,7 @@ QDF_STATUS sme_update_roam_scan_n_probes(mac_handle_t mac_handle,
const uint8_t probes)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.uint_value = probes;
return wlan_cm_roam_cfg_set_value(mac->psoc, vdev_id,
@@ -5902,7 +5902,7 @@ sme_update_roam_scan_home_away_time(mac_handle_t mac_handle, uint8_t vdev_id,
const bool send_offload_cmd)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.bool_value = send_offload_cmd;
src_config.uint_value = roam_scan_home_away_time;
@@ -5996,7 +5996,7 @@ QDF_STATUS sme_update_roam_rssi_diff(mac_handle_t mac_handle, uint8_t vdev_id,
uint8_t roam_rssi_diff)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.uint_value = roam_rssi_diff;
return wlan_cm_roam_cfg_set_value(mac->psoc, vdev_id,
@@ -6622,7 +6622,7 @@ QDF_STATUS sme_set_neighbor_scan_refresh_period(mac_handle_t mac_handle,
uint8_t sessionId, uint16_t neighborScanResultsRefreshPeriod)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.uint_value = neighborScanResultsRefreshPeriod;
return wlan_cm_roam_cfg_set_value(mac->psoc, sessionId,
@@ -6685,7 +6685,7 @@ QDF_STATUS sme_update_empty_scan_refresh_period(mac_handle_t mac_handle,
empty_scan_refresh_period)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.uint_value = empty_scan_refresh_period;
return wlan_cm_roam_cfg_set_value(mac->psoc, sessionId,
@@ -6698,7 +6698,7 @@ QDF_STATUS sme_update_full_roam_scan_period(mac_handle_t mac_handle,
uint32_t full_roam_scan_period)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.uint_value = full_roam_scan_period;
return wlan_cm_roam_cfg_set_value(mac->psoc, vdev_id,
@@ -6711,7 +6711,7 @@ sme_modify_roam_cand_sel_criteria(mac_handle_t mac_handle,
bool enable_scoring_for_roam)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.bool_value = enable_scoring_for_roam;
return wlan_cm_roam_cfg_set_value(mac->psoc, vdev_id,
@@ -6750,7 +6750,7 @@ QDF_STATUS sme_set_neighbor_scan_min_chan_time(mac_handle_t mac_handle,
uint8_t sessionId)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.uint_value = nNeighborScanMinChanTime;
return wlan_cm_roam_cfg_set_value(mac->psoc, sessionId,
@@ -6776,7 +6776,7 @@ QDF_STATUS sme_set_neighbor_scan_max_chan_time(mac_handle_t mac_handle,
nNeighborScanMaxChanTime)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.uint_value = nNeighborScanMaxChanTime;
return wlan_cm_roam_cfg_set_value(mac->psoc, sessionId,
@@ -6949,7 +6949,7 @@ QDF_STATUS sme_set_neighbor_scan_period(mac_handle_t mac_handle,
const uint16_t nNeighborScanPeriod)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
src_config.uint_value = nNeighborScanPeriod;
return wlan_cm_roam_cfg_set_value(mac->psoc, sessionId,
@@ -7029,7 +7029,7 @@ sme_update_roam_scan_freq_list(mac_handle_t mac_handle, uint8_t vdev_id,
uint32_t freq_list_type)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
if (!sme_validate_freq_list(mac_handle, freq_list, num_chan)) {
sme_err("List contains invalid channel(s)");
@@ -15670,7 +15670,7 @@ QDF_STATUS sme_set_roam_config_enable(mac_handle_t mac_handle,
uint8_t roam_control_enable)
{
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
if (!mac->mlme_cfg->lfr.roam_scan_offload_enabled)
return QDF_STATUS_E_INVAL;

Näytä tiedosto

@@ -2972,7 +2972,7 @@ QDF_STATUS csr_roam_ndi_stop(struct mac_context *mac_ctx, uint8_t vdev_id)
static void csr_fill_single_pmk(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
struct bss_description *bss_desc)
{
struct cm_roam_values_copy src_cfg;
struct cm_roam_values_copy src_cfg = {};
src_cfg.bool_value = bss_desc->is_single_pmk;
wlan_cm_roam_cfg_set_value(psoc, vdev_id,
@@ -4877,7 +4877,7 @@ QDF_STATUS csr_set_pmk_cache_ft(struct mac_context *mac, uint8_t vdev_id,
sme_debug("Auth type: %x update the MDID in cache", akm);
cm_update_pmk_cache_ft(mac->psoc, vdev_id);
} else {
struct cm_roam_values_copy src_cfg;
struct cm_roam_values_copy src_cfg = {};
struct scan_filter *scan_filter;
qdf_list_t *list = NULL;
struct scan_cache_node *first_node = NULL;
@@ -5334,7 +5334,7 @@ static void csr_fill_connected_profile(struct mac_context *mac_ctx,
struct bss_description *bss_desc = NULL;
tDot11fBeaconIEs *bcn_ies;
sme_QosAssocInfo assoc_info;
struct cm_roam_values_copy src_cfg;
struct cm_roam_values_copy src_cfg = {};
bool is_ese = false;
uint8_t country_code[REG_ALPHA2_LEN + 1];
@@ -5433,7 +5433,7 @@ QDF_STATUS cm_csr_connect_rsp(struct wlan_objmgr_vdev *vdev,
struct mac_context *mac_ctx;
uint8_t vdev_id = wlan_vdev_get_id(vdev);
struct csr_roam_session *session;
struct cm_roam_values_copy src_config;
struct cm_roam_values_copy src_config = {};
/*
* This API is to update legacy struct and should be removed once

Näytä tiedosto

@@ -3049,7 +3049,7 @@ QDF_STATUS wma_set_cts2self_for_p2p_go(void *wma_handle,
{
int32_t ret;
tp_wma_handle wma = (tp_wma_handle)wma_handle;
struct pdev_params pdevparam;
struct pdev_params pdevparam = {};
pdevparam.param_id = WMI_PDEV_PARAM_CTS2SELF_FOR_P2P_GO_CONFIG;
pdevparam.param_value = cts2self_for_p2p_go;

Näytä tiedosto

@@ -1087,7 +1087,7 @@ QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
int32_t ret = 0;
uint32_t txpower_params2g = 0;
uint32_t txpower_params5g = 0;
struct pdev_params pdevparam;
struct pdev_params pdevparam = {};
struct wmi_unified *wmi_handle;
if (wma_validate_handle(wma))
@@ -1456,7 +1456,7 @@ QDF_STATUS wma_set_idle_ps_config(void *wma_ptr, uint32_t idle_ps)
{
int32_t ret;
tp_wma_handle wma = (tp_wma_handle) wma_ptr;
struct pdev_params pdevparam;
struct pdev_params pdevparam = {};
wma_debug("WMA Set Idle Ps Config [1:set 0:clear] val %d", idle_ps);

Näytä tiedosto

@@ -4060,7 +4060,7 @@ QDF_STATUS wma_set_vc_mode_config(void *wma_handle,
{
int32_t ret;
tp_wma_handle wma = (tp_wma_handle)wma_handle;
struct pdev_params pdevparam;
struct pdev_params pdevparam = {};
pdevparam.param_id = WMI_PDEV_UPDATE_WDCVS_ALGO;
pdevparam.param_value = vc_bitmap;