qcacld-3.0: Fix uninitialized scalar variable
Issue1:wlan_hdd_set_mlo_ps function returns uninitialized status on condition of being all link_adapters as NULL from mlo_adapter_info. Fix:initialize status varible with -EINVAL. Issue2:hdd_regulatory_init API updates regulatory alpha2 from uninitialized alpha2 array. Fix:initialize alpha2 array with 0. Change-Id: I7e279899a8465a9b457fbe06ff81c57364be2843 CRs-Fixed: 3307965
This commit is contained in:

committed by
Madan Koyyalamudi

parent
2c512a643c
commit
420534c839
@@ -2873,7 +2873,7 @@ static int wlan_hdd_set_mlo_ps(struct wlan_objmgr_psoc *psoc,
|
|||||||
{
|
{
|
||||||
struct hdd_adapter *link_adapter;
|
struct hdd_adapter *link_adapter;
|
||||||
struct hdd_mlo_adapter_info *mlo_adapter_info;
|
struct hdd_mlo_adapter_info *mlo_adapter_info;
|
||||||
int i, status;
|
int i, status = -EINVAL;
|
||||||
|
|
||||||
mlo_adapter_info = &adapter->mlo_adapter_info;
|
mlo_adapter_info = &adapter->mlo_adapter_info;
|
||||||
for (i = 0; i < WLAN_MAX_MLD; i++) {
|
for (i = 0; i < WLAN_MAX_MLD; i++) {
|
||||||
|
@@ -1925,7 +1925,6 @@ int hdd_regulatory_init(struct hdd_context *hdd_ctx, struct wiphy *wiphy)
|
|||||||
{
|
{
|
||||||
bool offload_enabled;
|
bool offload_enabled;
|
||||||
struct regulatory_channel *cur_chan_list;
|
struct regulatory_channel *cur_chan_list;
|
||||||
uint8_t alpha2[REG_ALPHA2_LEN + 1];
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
cur_chan_list = qdf_mem_malloc(sizeof(*cur_chan_list) * NUM_CHANNELS);
|
cur_chan_list = qdf_mem_malloc(sizeof(*cur_chan_list) * NUM_CHANNELS);
|
||||||
@@ -1967,7 +1966,7 @@ int hdd_regulatory_init(struct hdd_context *hdd_ctx, struct wiphy *wiphy)
|
|||||||
fill_wiphy_band_channels(wiphy, cur_chan_list, NL80211_BAND_2GHZ);
|
fill_wiphy_band_channels(wiphy, cur_chan_list, NL80211_BAND_2GHZ);
|
||||||
fill_wiphy_band_channels(wiphy, cur_chan_list, NL80211_BAND_5GHZ);
|
fill_wiphy_band_channels(wiphy, cur_chan_list, NL80211_BAND_5GHZ);
|
||||||
fill_wiphy_6ghz_band_channels(wiphy, cur_chan_list);
|
fill_wiphy_6ghz_band_channels(wiphy, cur_chan_list);
|
||||||
qdf_mem_copy(hdd_ctx->reg.alpha2, alpha2, REG_ALPHA2_LEN + 1);
|
qdf_mem_zero(hdd_ctx->reg.alpha2, REG_ALPHA2_LEN + 1);
|
||||||
|
|
||||||
qdf_mem_free(cur_chan_list);
|
qdf_mem_free(cur_chan_list);
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user