qcacld-3.0: HDD: Remove excessive logs - Part 1

Remove log in callers of the following function:

qdf_mem_malloc()

Change-Id: I33019772f0c9289eb7e770cfa98739e0260cca81
CRs-Fixed: 2331653
这个提交包含在:
Min Liu
2018-10-10 19:59:07 +08:00
提交者 nshrivas
父节点 f13a016797
当前提交 74a1a5032f
修改 9 个文件,包含 44 行新增124 行删除

查看文件

@@ -235,10 +235,8 @@ static int hdd_set_reset_apf_offload(struct hdd_context *hdd_ctx,
}
apf_set_offload = qdf_mem_malloc(sizeof(*apf_set_offload));
if (!apf_set_offload) {
hdd_err("qdf_mem_malloc failed for apf_set_offload");
if (!apf_set_offload)
return -ENOMEM;
}
/* Parse and fetch apf packet size */
if (!tb[APF_PACKET_SIZE]) {
@@ -264,7 +262,6 @@ static int hdd_set_reset_apf_offload(struct hdd_context *hdd_ctx,
apf_set_offload->program = qdf_mem_malloc(sizeof(uint8_t) * prog_len);
if (!apf_set_offload->program) {
hdd_err("qdf_mem_malloc failed for apf offload program");
ret = -ENOMEM;
goto fail;
}
@@ -402,10 +399,8 @@ hdd_apf_write_memory(struct hdd_adapter *adapter, struct nlattr **tb)
write_mem_params.buf = qdf_mem_malloc(sizeof(uint8_t)
* write_mem_params.length);
if (write_mem_params.buf == NULL) {
hdd_err("failed to alloc mem for apf write mem operation");
if (!write_mem_params.buf)
return -EINVAL;
}
nla_memcpy(write_mem_params.buf, tb[APF_PROGRAM],
write_mem_params.length);
@@ -537,10 +532,8 @@ static int hdd_apf_read_memory(struct hdd_adapter *adapter, struct nlattr **tb)
return -EINVAL;
}
bufptr = qdf_mem_malloc(read_mem_params.length);
if (bufptr == NULL) {
hdd_err("alloc failed for cumulative event buffer");
if (!bufptr)
return -ENOMEM;
}
qdf_event_reset(&context->qdf_apf_event);
context->offset = read_mem_params.addr_offset;

查看文件

@@ -1074,10 +1074,9 @@ hdd_send_ft_assoc_response(struct net_device *dev,
/* We need to send the IEs to the supplicant. */
buff = qdf_mem_malloc(IW_GENERIC_IE_MAX);
if (buff == NULL) {
hdd_err("unable to allocate memory");
if (!buff)
return;
}
/* Send the Assoc Resp, the supplicant needs this for initial Auth. */
len = pCsrRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET;
wrqu.data.length = len;
@@ -1159,10 +1158,8 @@ static void hdd_send_ft_event(struct hdd_adapter *adapter)
#else
/* We need to send the IEs to the supplicant */
buff = qdf_mem_malloc(IW_CUSTOM_MAX);
if (buff == NULL) {
hdd_err("unable to allocate memory");
if (!buff)
return;
}
/* Sme needs to send the RIC IEs first */
str_len = strlcpy(buff, "RIC=", IW_CUSTOM_MAX);
@@ -1274,10 +1271,8 @@ hdd_send_update_beacon_ies_event(struct hdd_adapter *adapter,
/* We need to send the IEs to the supplicant. */
buff = qdf_mem_malloc(IW_CUSTOM_MAX);
if (buff == NULL) {
hdd_err("unable to allocate memory");
if (!buff)
return;
}
strLen = strlcpy(buff, "BEACONIEs=", IW_CUSTOM_MAX);
currentLen = strLen + 1;
@@ -3838,10 +3833,9 @@ roam_roam_connect_status_update_handler(struct hdd_adapter *adapter,
}
sta_ctx->ibss_sta_generation++;
stainfo = qdf_mem_malloc(sizeof(*stainfo));
if (stainfo == NULL) {
hdd_err("memory allocation for station_info failed");
if (!stainfo)
return QDF_STATUS_E_NOMEM;
}
stainfo->filled = 0;
stainfo->generation = sta_ctx->ibss_sta_generation;

查看文件

@@ -1621,10 +1621,8 @@ int wlan_hdd_sap_cfg_dfs_override(struct hdd_adapter *adapter)
sap_config->acs_cfg.ch_list = qdf_mem_malloc(
sizeof(uint8_t) *
con_sap_config->acs_cfg.ch_list_count);
if (!sap_config->acs_cfg.ch_list) {
hdd_err("ACS config alloc fail");
if (!sap_config->acs_cfg.ch_list)
return -ENOMEM;
}
qdf_mem_copy(sap_config->acs_cfg.ch_list,
con_sap_config->acs_cfg.ch_list,
@@ -2269,10 +2267,8 @@ int hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter,
sap_config->channel_info = qdf_mem_malloc(
sizeof(struct hdd_channel_info) *
channel_count);
if (!sap_config->channel_info) {
hdd_err("memory allocation failed");
if (!sap_config->channel_info)
return -ENOMEM;
}
hdd_update_reg_chan_info(adapter, channel_count, channel_list);
hdd_get_freq_list(channel_list, freq_list, channel_count);
@@ -2405,10 +2401,9 @@ static int hdd_create_acs_timer(struct hdd_adapter *adapter)
hdd_debug("Starting vendor app based ACS");
timer_context = qdf_mem_malloc(sizeof(*timer_context));
if (!timer_context) {
hdd_err("Could not allocate for timer_context");
if (!timer_context)
return -ENOMEM;
}
timer_context->adapter = adapter;
set_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags);
@@ -2644,7 +2639,6 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
sizeof(uint8_t) *
sap_config->acs_cfg.ch_list_count);
if (!sap_config->acs_cfg.ch_list) {
hdd_err("ACS config alloc fail");
ret = -ENOMEM;
goto out;
}
@@ -2662,7 +2656,6 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
sap_config->acs_cfg.ch_list = qdf_mem_malloc(
sap_config->acs_cfg.ch_list_count);
if (!sap_config->acs_cfg.ch_list) {
hdd_err("ACS config alloc fail");
ret = -ENOMEM;
goto out;
}
@@ -3254,10 +3247,8 @@ __wlan_hdd_cfg80211_set_scanning_mac_oui(struct wiphy *wiphy,
return -EINVAL;
}
pReqMsg = qdf_mem_malloc(sizeof(*pReqMsg));
if (!pReqMsg) {
hdd_err("qdf_mem_malloc failed");
if (!pReqMsg)
return -ENOMEM;
}
if (!tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI]) {
hdd_err("attr mac oui failed");
@@ -4002,10 +3993,8 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
}
roam_params = qdf_mem_malloc(sizeof(*roam_params));
if (!roam_params) {
hdd_err("failed to allocate memory");
if (!roam_params)
return -ENOMEM;
}
ret = hdd_set_ext_roam_params(hdd_ctx, data, data_len,
adapter->session_id, roam_params);
@@ -4806,10 +4795,8 @@ void wlan_hdd_save_gtk_offload_params(struct hdd_adapter *adapter,
QDF_STATUS status = QDF_STATUS_E_FAILURE;
gtk_req = qdf_mem_malloc(sizeof(*gtk_req));
if (!gtk_req) {
hdd_err("cannot allocate gtk_req");
if (!gtk_req)
return;
}
hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if (kck_ptr)
@@ -6208,10 +6195,9 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy,
hdd_enter_dev(dev);
sme_config = qdf_mem_malloc(sizeof(*sme_config));
if (!sme_config) {
hdd_err("mem alloc failed for sme_config");
if (!sme_config)
return -ENOMEM;
}
mac_handle = hdd_ctx->mac_handle;
sme_get_config_param(mac_handle, sme_config);
@@ -6924,10 +6910,8 @@ wlan_hdd_add_tx_ptrn(struct hdd_adapter *adapter, struct hdd_context *hdd_ctx,
}
add_req = qdf_mem_malloc(sizeof(*add_req));
if (!add_req) {
hdd_err("memory allocation failed");
if (!add_req)
return -ENOMEM;
}
/* Parse and fetch request Id */
if (!tb[PARAM_REQUEST_ID]) {
@@ -7073,10 +7057,8 @@ wlan_hdd_del_tx_ptrn(struct hdd_adapter *adapter, struct hdd_context *hdd_ctx,
}
del_req = qdf_mem_malloc(sizeof(*del_req));
if (!del_req) {
hdd_err("memory allocation failed");
if (!del_req)
return -ENOMEM;
}
qdf_copy_macaddr(&del_req->mac_address, &adapter->mac_addr);
hdd_debug(MAC_ADDRESS_STR, MAC_ADDR_ARRAY(del_req->mac_address.bytes));
@@ -8965,10 +8947,8 @@ static int hdd_parse_vendor_acs_chan_config(struct hdd_vendor_chan_info
channel_list = qdf_mem_malloc(sizeof(struct hdd_vendor_chan_info) *
(*channel_cnt));
if (NULL == channel_list) {
hdd_err("Could not allocate for channel_list");
if (!channel_list)
return -ENOMEM;
}
i = 0;
nla_for_each_nested(curr_attr, tb[SET_CHAN_CHAN_LIST], rem) {
@@ -10350,10 +10330,8 @@ static int hdd_populate_dns_stats_info(struct hdd_adapter *adapter,
uint8_t *dns_query;
dns_query = qdf_mem_malloc(adapter->track_dns_domain_len + 1);
if (!dns_query) {
hdd_err("mem alloc fail");
if (!dns_query)
return -EINVAL;
}
qdf_mem_copy(dns_query, adapter->dns_payload,
adapter->track_dns_domain_len);
@@ -12270,10 +12248,8 @@ int wlan_hdd_cfg80211_init(struct device *dev,
wiphy->bands[HDD_NL80211_BAND_2GHZ] = &wlan_hdd_band_2_4_ghz;
wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels =
qdf_mem_malloc(sizeof(hdd_channels_2_4_ghz));
if (wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels == NULL) {
hdd_err("Not enough memory to allocate channels");
if (!wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels)
return -ENOMEM;
}
qdf_mem_copy(wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels,
&hdd_channels_2_4_ghz[0],
sizeof(hdd_channels_2_4_ghz));
@@ -12313,10 +12289,8 @@ int wlan_hdd_cfg80211_init(struct device *dev,
if (pCfg->gcmp_enabled) {
cipher_suites = qdf_mem_malloc(sizeof(hdd_cipher_suites) +
sizeof(hdd_gcmp_cipher_suits));
if (cipher_suites == NULL) {
hdd_err("Not enough memory for cipher suites");
if (!cipher_suites)
return -ENOMEM;
}
wiphy->n_cipher_suites = QDF_ARRAY_SIZE(hdd_cipher_suites) +
QDF_ARRAY_SIZE(hdd_gcmp_cipher_suits);
qdf_mem_copy(cipher_suites, &hdd_cipher_suites,
@@ -12326,10 +12300,8 @@ int wlan_hdd_cfg80211_init(struct device *dev,
sizeof(hdd_gcmp_cipher_suits));
} else {
cipher_suites = qdf_mem_malloc(sizeof(hdd_cipher_suites));
if (cipher_suites == NULL) {
hdd_err("Not enough memory for cipher suites");
if (!cipher_suites)
return -ENOMEM;
}
wiphy->n_cipher_suites = QDF_ARRAY_SIZE(hdd_cipher_suites);
qdf_mem_copy(cipher_suites, &hdd_cipher_suites,
sizeof(hdd_cipher_suites));
@@ -12894,10 +12866,8 @@ static void wlan_hdd_set_dhcp_server_offload(struct hdd_adapter *adapter)
QDF_STATUS status;
pDhcpSrvInfo = qdf_mem_malloc(sizeof(*pDhcpSrvInfo));
if (NULL == pDhcpSrvInfo) {
hdd_err("could not allocate tDhcpSrvOffloadInfo!");
if (!pDhcpSrvInfo)
return;
}
pDhcpSrvInfo->vdev_id = adapter->session_id;
pDhcpSrvInfo->dhcpSrvOffloadEnabled = true;
@@ -14250,10 +14220,8 @@ wlan_hdd_inform_bss_frame(struct hdd_adapter *adapter,
bss_data.frame_len = ie_length + offsetof(struct ieee80211_mgmt,
u.probe_resp.variable);
bss_data.mgmt = qdf_mem_malloc(bss_data.frame_len);
if (!bss_data.mgmt) {
hdd_err("memory allocation failed");
if (!bss_data.mgmt)
return NULL;
}
memcpy(bss_data.mgmt->bssid, bss_desc->bssId, ETH_ALEN);
@@ -15050,7 +15018,6 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
sme_config = qdf_mem_malloc(sizeof(*sme_config));
if (!sme_config) {
hdd_err("unable to allocate sme_config");
hdd_conn_set_connection_state(adapter,
eConnectionState_NotConnected);
status = -ENOMEM;
@@ -15314,10 +15281,8 @@ static int wlan_hdd_cfg80211_set_fils_config(struct hdd_adapter *adapter,
roam_profile->fils_con_info =
qdf_mem_malloc(sizeof(*roam_profile->fils_con_info));
if (!roam_profile->fils_con_info) {
hdd_err("failed to allocate memory");
if (!roam_profile->fils_con_info)
return -EINVAL;
}
/*
* The initial connection for FILS may happen with an OPEN
* auth type. Hence we need to allow the connection to go
@@ -15735,10 +15700,8 @@ static void wlan_hdd_save_hlp_ie(struct csr_roam_profile *roam_profile,
roam_profile->hlp_ie =
qdf_mem_malloc(FILS_MAX_HLP_DATA_LEN);
hlp_ie = roam_profile->hlp_ie;
if (!hlp_ie) {
hdd_err("HLP IE mem alloc fails");
if (!hlp_ie)
return;
}
}
qdf_mem_copy(hlp_ie + roam_profile->hlp_ie_len, gen_ie, len);
@@ -18660,7 +18623,6 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy,
gtk_req = qdf_mem_malloc(sizeof(*gtk_req));
if (!gtk_req) {
hdd_err("cannot allocate gtk_req");
result = -ENOMEM;
goto out;
}
@@ -18981,10 +18943,8 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
hb_params = (struct pmo_lphb_req *)qdf_mem_malloc(
sizeof(*hb_params));
if (NULL == hb_params) {
hdd_err("Request Buffer Alloc Fail");
if (!hb_params)
return -ENOMEM;
}
qdf_mem_zero(hb_params, sizeof(*hb_params));
qdf_mem_copy(hb_params, buf, buf_len);
@@ -19681,10 +19641,8 @@ void wlan_hdd_init_chan_info(struct hdd_context *hdd_ctx)
hdd_ctx->chan_info =
qdf_mem_malloc(sizeof(struct scan_chan_info)
* QDF_MAX_NUM_CHAN);
if (hdd_ctx->chan_info == NULL) {
hdd_err("Failed to malloc for chan info");
if (!hdd_ctx->chan_info)
return;
}
mutex_init(&hdd_ctx->chan_info_lock);
num_2g = QDF_ARRAY_SIZE(hdd_channels_2_4_ghz);

查看文件

@@ -316,7 +316,6 @@ static int wlan_hdd_llstats_alloc_buf(void)
ll_stats.result = qdf_mem_malloc(DEBUGFS_LLSTATS_BUF_SIZE);
if (!ll_stats.result) {
mutex_unlock(&llstats_mutex);
hdd_err("LL Stats buffer allocation failed");
return -EINVAL;
}
mutex_unlock(&llstats_mutex);

查看文件

@@ -1780,10 +1780,8 @@ static __iw_softap_getassoc_stamacaddr(struct net_device *dev,
/* allocate local buffer to build the response */
buf = qdf_mem_malloc(wrqu->data.length);
if (!buf) {
hdd_err("failed to allocate response buffer");
if (!buf)
return -ENOMEM;
}
/* start indexing beyond where the record count will be written */
maclist_index = sizeof(maclist_index);

查看文件

@@ -3395,10 +3395,8 @@ static void __hdd_set_multicast_list(struct net_device *dev)
}
mc_list_request = qdf_mem_malloc(sizeof(*mc_list_request));
if (!mc_list_request) {
hdd_err("Cannot allocate mc_list_request");
if (!mc_list_request)
goto out;
}
/* Delete already configured multicast address list */
if (adapter->mc_addr_list.mc_cnt > 0) {
@@ -7682,10 +7680,8 @@ static int wlan_hdd_init_tx_rx_histogram(struct hdd_context *hdd_ctx)
{
hdd_ctx->hdd_txrx_hist = qdf_mem_malloc(
(sizeof(struct hdd_tx_rx_histogram) * NUM_TX_RX_HISTOGRAM));
if (hdd_ctx->hdd_txrx_hist == NULL) {
hdd_err("Failed malloc for hdd_txrx_hist");
if (!hdd_ctx->hdd_txrx_hist)
return -ENOMEM;
}
return 0;
}
@@ -7810,10 +7806,8 @@ hdd_display_netif_queue_history_compact(struct hdd_context *hdd_ctx)
comb_log_str_size = (ADAP_NETIFQ_LOG_LEN * CSR_ROAM_SESSION_MAX) + 1;
comb_log_str = qdf_mem_malloc(comb_log_str_size);
if (!comb_log_str) {
hdd_err("failed to alloc comb_log_str");
if (!comb_log_str)
return;
}
bytes_written = 0;
@@ -8516,11 +8510,8 @@ int hdd_clone_local_unsafe_chan(struct hdd_context *hdd_ctx,
if (chan_count) {
size = chan_count * sizeof(hdd_ctx->unsafe_channel_list[0]);
unsafe_list = qdf_mem_malloc(size);
if (!unsafe_list) {
hdd_err("No memory for unsafe chan list size%d",
size);
if (!unsafe_list)
return -ENOMEM;
}
qdf_mem_copy(unsafe_list, hdd_ctx->unsafe_channel_list, size);
} else {
unsafe_list = NULL;
@@ -9018,8 +9009,7 @@ static struct hdd_context *hdd_context_create(struct device *dev)
hdd_ctx->last_scan_reject_session_id = 0xFF;
hdd_ctx->config = qdf_mem_malloc(sizeof(struct hdd_config));
if (hdd_ctx->config == NULL) {
hdd_err("Failed to alloc memory for HDD config!");
if (!hdd_ctx->config) {
ret = -ENOMEM;
goto err_free_hdd_context;
}
@@ -9378,11 +9368,9 @@ static int hdd_update_cds_config(struct hdd_context *hdd_ctx)
bool fw_timeout_crash;
QDF_STATUS status;
cds_cfg = (struct cds_config_info *)qdf_mem_malloc(sizeof(*cds_cfg));
if (!cds_cfg) {
hdd_err("failed to allocate cds config");
cds_cfg = qdf_mem_malloc(sizeof(*cds_cfg));
if (!cds_cfg)
return -ENOMEM;
}
cds_cfg->driver_type = QDF_DRIVER_TYPE_PRODUCTION;
cds_cfg->sta_maxlimod_dtim = hdd_ctx->config->fMaxLIModulatedDTIM;
@@ -9518,10 +9506,8 @@ static int hdd_update_user_config(struct hdd_context *hdd_ctx)
return -EIO;
user_config = qdf_mem_malloc(sizeof(*user_config));
if (user_config == NULL) {
hdd_alert("Failed to alloc memory for user_config!");
if (!user_config)
return -ENOMEM;
}
user_config->dot11_mode = hdd_ctx->config->dot11Mode;
user_config->dual_mac_feature_disable =

查看文件

@@ -368,10 +368,8 @@ void hdd_enable_ns_offload(struct hdd_adapter *adapter,
}
ns_req = qdf_mem_malloc(sizeof(*ns_req));
if (!ns_req) {
hdd_err("fail to allocate ns_req");
if (!ns_req)
goto out;
}
ns_req->psoc = psoc;
ns_req->vdev_id = adapter->session_id;
@@ -872,10 +870,8 @@ void hdd_enable_arp_offload(struct hdd_adapter *adapter,
hdd_enter();
arp_req = qdf_mem_malloc(sizeof(*arp_req));
if (!arp_req) {
hdd_err("cannot allocate arp_req");
if (!arp_req)
goto out;
}
arp_req->psoc = psoc;
arp_req->vdev_id = adapter->session_id;

查看文件

@@ -397,10 +397,8 @@ wlan_hdd_enqueue_blocked_scan_request(struct net_device *dev,
qdf_mem_malloc(sizeof(*blocked_scan_req));
int ret = 0;
if (!blocked_scan_req) {
hdd_err("Failed to allocate scan_req");
if (!blocked_scan_req)
return -EINVAL;
}
blocked_scan_req->dev = dev;
blocked_scan_req->scan_request = request;

查看文件

@@ -5056,10 +5056,8 @@ static int __wlan_hdd_get_rcpi(struct hdd_adapter *adapter,
return 0;
rcpi_req = qdf_mem_malloc(sizeof(*rcpi_req));
if (!rcpi_req) {
hdd_err("unable to allocate memory for RCPI req");
if (!rcpi_req)
return -EINVAL;
}
request = osif_request_alloc(&params);
if (!request) {