Browse Source

qcacld-3.0: hdd: Remove logs for qdf_mem_malloc() checks

qdf_mem_malloc() function already takes care of logging the
caller function name and line number in case of any allocation error.
Hence there is no need to add the error log again.

Getting rid of these unnecessary logs reduces driver memory footprint.

Change-Id: I135bfe0e5adb018ebd676d3ac50f958ea9dedf71
CRs-Fixed: 2781932
Srinivas Girigowda 4 years ago
parent
commit
9200d0bba4

+ 2 - 8
core/hdd/src/wlan_hdd_cfg.c

@@ -260,9 +260,7 @@ QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx)
 	hdd_debug("wlan_mac.bin size %zu", fw->size);
 
 	temp = qdf_mem_malloc(fw->size + 1);
-
 	if (!temp) {
-		hdd_err("fail to alloc memory");
 		qdf_status = QDF_STATUS_E_NOMEM;
 		goto config_exit;
 	}
@@ -690,10 +688,8 @@ QDF_STATUS hdd_set_policy_mgr_user_cfg(struct hdd_context *hdd_ctx)
 	struct policy_mgr_user_cfg *user_cfg;
 
 	user_cfg = qdf_mem_malloc(sizeof(*user_cfg));
-	if (!user_cfg) {
-		hdd_err("unable to allocate user_cfg");
+	if (!user_cfg)
 		return QDF_STATUS_E_NOMEM;
-	}
 
 	status = ucfg_mlme_get_vht_enable2x2(hdd_ctx->psoc,
 					     &user_cfg->enable2x2);
@@ -883,10 +879,8 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
 	struct hdd_config *config = hdd_ctx->config;
 
 	sme_config = qdf_mem_malloc(sizeof(*sme_config));
-	if (!sme_config) {
-		hdd_err("unable to allocate sme_config");
+	if (!sme_config)
 		return QDF_STATUS_E_NOMEM;
-	}
 
 	/* Config params obtained from the registry
 	 * To Do: set regulatory information here

+ 4 - 9
core/hdd/src/wlan_hdd_cfg80211.c

@@ -15684,22 +15684,18 @@ wlan_hdd_iftype_data_alloc(struct hdd_context *hdd_ctx)
 	hdd_ctx->iftype_data_2g =
 			qdf_mem_malloc(sizeof(*hdd_ctx->iftype_data_2g));
 
-	if (!hdd_ctx->iftype_data_2g) {
-		hdd_err("mem alloc failed for 2g iftype data");
+	if (!hdd_ctx->iftype_data_2g)
 		return QDF_STATUS_E_NOMEM;
-	}
+
 	hdd_ctx->iftype_data_5g =
 			qdf_mem_malloc(sizeof(*hdd_ctx->iftype_data_5g));
-
 	if (!hdd_ctx->iftype_data_5g) {
-		hdd_err("mem alloc failed for 5g iftype data");
 		qdf_mem_free(hdd_ctx->iftype_data_2g);
 		hdd_ctx->iftype_data_2g = NULL;
 		return QDF_STATUS_E_NOMEM;
 	}
 
 	if (QDF_IS_STATUS_ERROR(wlan_hdd_iftype_data_alloc_6ghz(hdd_ctx))) {
-		hdd_err("mem alloc failed for 6g iftype data");
 		qdf_mem_free(hdd_ctx->iftype_data_5g);
 		qdf_mem_free(hdd_ctx->iftype_data_2g);
 		hdd_ctx->iftype_data_2g = NULL;
@@ -15846,10 +15842,9 @@ int wlan_hdd_cfg80211_init(struct device *dev,
 	 * stop modules. To avoid this,alloc in init domain in advance.
 	 */
 	hdd_ctx->channels_2ghz = qdf_mem_malloc(band_2_ghz_channels_size);
-	if (!hdd_ctx->channels_2ghz) {
-		hdd_err("Not enough memory to allocate channels");
+	if (!hdd_ctx->channels_2ghz)
 		return -ENOMEM;
-	}
+
 	hdd_ctx->channels_5ghz = qdf_mem_malloc(band_5_ghz_chanenls_size);
 	if (!hdd_ctx->channels_5ghz)
 		goto mem_fail_5g;

+ 0 - 2
core/hdd/src/wlan_hdd_debugfs.c

@@ -316,7 +316,6 @@ static ssize_t __wcnss_patterngen_write(struct net_device *net_dev,
 		delPeriodicTxPtrnParams =
 			qdf_mem_malloc(sizeof(tSirDelPeriodicTxPtrn));
 		if (!delPeriodicTxPtrnParams) {
-			hdd_err("Memory allocation failed!");
 			qdf_mem_free(cmd);
 			return -ENOMEM;
 		}
@@ -379,7 +378,6 @@ static ssize_t __wcnss_patterngen_write(struct net_device *net_dev,
 
 	addPeriodicTxPtrnParams = qdf_mem_malloc(sizeof(tSirAddPeriodicTxPtrn));
 	if (!addPeriodicTxPtrnParams) {
-		hdd_err("Memory allocation failed!");
 		qdf_mem_free(cmd);
 		return -ENOMEM;
 	}

+ 1 - 4
core/hdd/src/wlan_hdd_debugfs_csr.c

@@ -202,14 +202,11 @@ static int __wlan_hdd_open_debugfs_csr(struct hdd_adapter *adapter,
 	}
 
 	info = qdf_mem_malloc(sizeof(*info));
-	if (!info) {
-		hdd_err("Not enough memory for file private data");
+	if (!info)
 		return -ENOMEM;
-	}
 
 	info->data = qdf_mem_malloc(csr->buf_max_size);
 	if (!info->data) {
-		hdd_err("roam stats debugfs buffer allocation failed");
 		qdf_mem_free(info);
 		return -ENOMEM;
 	}

+ 2 - 6
core/hdd/src/wlan_hdd_debugfs_roam.c

@@ -85,10 +85,8 @@ hdd_roam_scan_stats_cb(void *context, struct wmi_roam_scan_stats_res *res)
 		    sizeof(struct wmi_roam_scan_stats_params);
 
 	stats_res = qdf_mem_malloc(total_len);
-	if (!stats_res) {
-		hdd_err("No memory for response");
+	if (!stats_res)
 		goto end;
-	}
 
 	qdf_mem_copy(stats_res, res, total_len);
 	priv->roam_scan_stats_res = stats_res;
@@ -164,10 +162,8 @@ wmi_roam_scan_stats_res *hdd_get_roam_scan_stats(struct hdd_context *hdd_ctx,
 		    sizeof(struct wmi_roam_scan_stats_params);
 
 	stats_res = qdf_mem_malloc(total_len);
-	if (!stats_res) {
-		hdd_err("No memory for response");
+	if (!stats_res)
 		goto cleanup;
-	}
 
 	qdf_mem_copy(stats_res, res, total_len);
 

+ 1 - 4
core/hdd/src/wlan_hdd_disa.c

@@ -90,7 +90,6 @@ static void hdd_encrypt_decrypt_msg_cb(void *cookie,
 			qdf_mem_malloc(sizeof(uint8_t) *
 				resp->data_len);
 		if (!context->response.data) {
-			hdd_err("memory allocation failed");
 			context->status = -ENOMEM;
 		} else {
 			qdf_mem_copy(context->response.data,
@@ -319,10 +318,8 @@ hdd_fill_encrypt_decrypt_params(struct disa_encrypt_decrypt_req_params
 			qdf_mem_malloc(sizeof(uint8_t) *
 				encrypt_decrypt_params->data_len);
 
-		if (!encrypt_decrypt_params->data) {
-			hdd_err("memory allocation failed");
+		if (!encrypt_decrypt_params->data)
 			return -ENOMEM;
-		}
 
 		qdf_mem_copy(encrypt_decrypt_params->data,
 			tmp + mac_hdr_len,

+ 7 - 15
core/hdd/src/wlan_hdd_ext_scan.c

@@ -1947,10 +1947,8 @@ __wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy,
 	}
 
 	params = qdf_mem_malloc(sizeof(*params));
-	if (!params) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!params)
 		return -ENOMEM;
-	}
 
 	/* assume the worst until proven otherwise */
 	retval = -EINVAL;
@@ -2131,10 +2129,8 @@ __wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy,
 	}
 
 	params = qdf_mem_malloc(sizeof(*params));
-	if (!params) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!params)
 		return -ENOMEM;
-	}
 
 	/* assume the worst until proven otherwise */
 	retval = -EINVAL;
@@ -3561,10 +3557,9 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
 			(num_networks * sizeof(req_msg->networks[0]));
 
 	req_msg = qdf_mem_malloc(len);
-	if (!req_msg) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!req_msg)
 		return -ENOMEM;
-	}
+
 	req_msg->num_networks = num_networks;
 
 	/* Parse and fetch request Id */
@@ -3885,10 +3880,9 @@ static int __wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy,
 
 	req_msg = qdf_mem_malloc(sizeof(*req_msg) +
 			(num_networks * sizeof(req_msg->networks[0])));
-	if (!req_msg) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!req_msg)
 		return -ENOMEM;
-	}
+
 	req_msg->num_networks = num_networks;
 
 	/* Parse and fetch request Id */
@@ -3997,10 +3991,8 @@ static int __wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy,
 	}
 
 	req_msg = qdf_mem_malloc(sizeof(*req_msg));
-	if (!req_msg) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!req_msg)
 		return -ENOMEM;
-	}
 
 	/* Parse and fetch request Id */
 	id = QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID;

+ 3 - 4
core/hdd/src/wlan_hdd_fips.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -59,10 +59,9 @@ static int hdd_fips_event_dup(struct wmi_host_fips_event_param *dest,
 	*dest = *src;
 	if  (dest->data_len) {
 		dest->data = qdf_mem_malloc(dest->data_len);
-		if (!dest->data) {
-			hdd_err("memory allocation failed");
+		if (!dest->data)
 			return -ENOMEM;
-		}
+
 		qdf_mem_copy(dest->data, src->data, src->data_len);
 	} else {
 		/* make sure we don't have a rogue pointer */

+ 2 - 4
core/hdd/src/wlan_hdd_ftm.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -61,10 +61,8 @@ int hdd_update_cds_config_ftm(struct hdd_context *hdd_ctx)
 	bool self_recovery;
 
 	cds_cfg = qdf_mem_malloc(sizeof(*cds_cfg));
-	if (!cds_cfg) {
-		hdd_err("failed to allocate cds config");
+	if (!cds_cfg)
 		return -ENOMEM;
-	}
 
 	status = ucfg_mlme_get_self_recovery(hdd_ctx->psoc, &self_recovery);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 5 - 16
core/hdd/src/wlan_hdd_hostapd.c

@@ -2336,10 +2336,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			uint32_t ies_len = event->ies_len;
 
 			sta_info = qdf_mem_malloc(sizeof(*sta_info));
-			if (!sta_info) {
-				hdd_err("Failed to allocate station info");
+			if (!sta_info)
 				return QDF_STATUS_E_FAILURE;
-			}
 
 			sta_info->assoc_req_ies = event->ies;
 			sta_info->assoc_req_ies_len = ies_len;
@@ -3890,11 +3888,9 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
 			sap_config->ch_params.center_freq_seg1 = channel_seg2;
 
 			sme_config = qdf_mem_malloc(sizeof(*sme_config));
-
-			if (!sme_config) {
-				hdd_err("Unable to allocate memory for smeconfig!");
+			if (!sme_config)
 				return -ENOMEM;
-			}
+
 			sme_get_config_param(mac_handle, sme_config);
 			switch (channel_type) {
 			case NL80211_CHAN_HT20:
@@ -4195,11 +4191,9 @@ wlan_hdd_cfg80211_alloc_new_beacon(struct hdd_adapter *adapter,
 		proberesp_ies_len + assocresp_ies_len;
 
 	beacon = qdf_mem_malloc(size);
-
-	if (!beacon) {
-		hdd_err("Mem allocation for beacon failed");
+	if (!beacon)
 		return -ENOMEM;
-	}
+
 	if (dtim_period)
 		beacon->dtim_period = dtim_period;
 	else if (old)
@@ -4314,7 +4308,6 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
 	}
 
 	genie = qdf_mem_malloc(MAX_GENIE_LEN);
-
 	if (!genie)
 		return -ENOMEM;
 
@@ -4351,8 +4344,6 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
 	proberesp_ies = qdf_mem_malloc(beacon->proberesp_ies_len +
 				      MAX_GENIE_LEN);
 	if (!proberesp_ies) {
-		hdd_err("mem alloc failed for probe resp ies, size: %d",
-			beacon->proberesp_ies_len + MAX_GENIE_LEN);
 		ret = -EINVAL;
 		goto done;
 	}
@@ -5184,7 +5175,6 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 
 	sme_config = qdf_mem_malloc(sizeof(*sme_config));
 	if (!sme_config) {
-		hdd_err("failed to allocate memory");
 		ret = -ENOMEM;
 		goto free;
 	}
@@ -6739,7 +6729,6 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 			sta_inactivity_timer = qdf_mem_malloc(
 					sizeof(*sta_inactivity_timer));
 			if (!sta_inactivity_timer) {
-				hdd_err("Failed to allocate Memory");
 				status = QDF_STATUS_E_FAILURE;
 				goto err_start_bss;
 			}

+ 1 - 3
core/hdd/src/wlan_hdd_hostapd_wext.c

@@ -1940,10 +1940,8 @@ static int iw_get_channel_list(struct net_device *dev,
 		return ret;
 
 	cur_chan_list = qdf_mem_malloc(sizeof(*cur_chan_list) * NUM_CHANNELS);
-	if (!cur_chan_list) {
-		hdd_err_rl("Failed to malloc");
+	if (!cur_chan_list)
 		return -ENOMEM;
-	}
 
 	status = ucfg_reg_get_current_chan_list(hdd_ctx->pdev, cur_chan_list);
 	if (status != QDF_STATUS_SUCCESS) {

+ 9 - 20
core/hdd/src/wlan_hdd_ioctl.c

@@ -476,10 +476,8 @@ hdd_parse_send_action_frame_v1_data(const uint8_t *command,
 	 * If N = 19, then we need 10 bytes, hence (19 + 1)/2 = 10 bytes
 	 */
 	*buf = qdf_mem_malloc((*buf_len + 1) / 2);
-	if (!*buf) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!*buf)
 		return -ENOMEM;
-	}
 
 	/* the buffer received from the upper layer is character buffer,
 	 * we need to prepare the buffer taking 2 characters in to a U8 hex
@@ -904,7 +902,6 @@ hdd_sendactionframe(struct hdd_adapter *adapter, const uint8_t *bssid,
 	frame_len = payload_len + 24;
 	frame = qdf_mem_malloc(frame_len);
 	if (!frame) {
-		hdd_err("memory allocation failed");
 		ret = -ENOMEM;
 		goto exit;
 	}
@@ -2526,10 +2523,9 @@ static int hdd_parse_get_cckm_ie(uint8_t *command, uint8_t **cckm_ie,
 	 * If N = 19, then we need 10 bytes, hence (19 + 1) / 2 = 10 bytes
 	 */
 	*cckm_ie = qdf_mem_malloc((*cckm_ie_len + 1) / 2);
-	if (!*cckm_ie) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!*cckm_ie)
 		return -ENOMEM;
-	}
+
 	/*
 	 * the buffer received from the upper layer is character buffer,
 	 * we need to prepare the buffer taking 2 characters in to a U8 hex
@@ -3321,11 +3317,9 @@ void hdd_get_roam_scan_ch_cb(hdd_handle_t hdd_handle,
 			return;
 		}
 		event = (uint8_t *)qdf_mem_malloc(len);
-		if (!event) {
-			hdd_err("Failed to alloc event response buf vdev_id: %d",
-				roam_ch->vdev_id);
+		if (!event)
 			return;
-		}
+
 		freq = (uint32_t *)event;
 		for (i = 0; i < roam_ch->num_channels &&
 		     i < WNI_CFG_VALID_CHANNEL_LIST_LEN; i++) {
@@ -5543,10 +5537,9 @@ static int hdd_set_rx_filter(struct hdd_adapter *adapter, bool action,
 
 
 		filter = qdf_mem_malloc(sizeof(*filter));
-		if (!filter) {
-			hdd_err("Could not allocate Memory");
+		if (!filter)
 			return -ENOMEM;
-		}
+
 		filter->action = action;
 		for (i = 0, j = 0; i < adapter->mc_addr_list.mc_cnt; i++) {
 			if (!memcmp(adapter->mc_addr_list.addr[i],
@@ -6290,16 +6283,14 @@ static int hdd_alloc_chan_cache(struct hdd_context *hdd_ctx, int num_chan)
 {
 	hdd_ctx->original_channels =
 			qdf_mem_malloc(sizeof(struct hdd_cache_channels));
-	if (!hdd_ctx->original_channels) {
-		hdd_err("QDF_MALLOC_ERR");
+	if (!hdd_ctx->original_channels)
 		return -ENOMEM;
-	}
+
 	hdd_ctx->original_channels->num_channels = num_chan;
 	hdd_ctx->original_channels->channel_info =
 					qdf_mem_malloc(num_chan *
 					sizeof(struct hdd_cache_channel_info));
 	if (!hdd_ctx->original_channels->channel_info) {
-		hdd_err("QDF_MALLOC_ERR");
 		hdd_ctx->original_channels->num_channels = 0;
 		qdf_mem_free(hdd_ctx->original_channels);
 		hdd_ctx->original_channels = NULL;
@@ -6779,7 +6770,6 @@ static int drv_cmd_get_ani_level(struct hdd_adapter *adapter,
 
 	extra = qdf_mem_malloc(user_size);
 	if (!extra) {
-		hdd_err("memory allocation failed");
 		ret = -ENOMEM;
 		goto parse_failed;
 	}
@@ -7126,7 +7116,6 @@ static int hdd_driver_command(struct hdd_adapter *adapter,
 	/* Allocate +1 for '\0' */
 	command = qdf_mem_malloc(priv_data->total_len + 1);
 	if (!command) {
-		hdd_err("failed to allocate memory");
 		ret = -ENOMEM;
 		goto exit;
 	}

+ 2 - 3
core/hdd/src/wlan_hdd_main.c

@@ -3533,10 +3533,9 @@ 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) {
-		hdd_err("failed to alloc memory");
+	if (!hdd_ctx->hdd_txrx_hist)
 		return -ENOMEM;
-	}
+
 	return 0;
 }
 

+ 1 - 3
core/hdd/src/wlan_hdd_object_manager.c

@@ -141,10 +141,8 @@ int hdd_objmgr_create_and_store_pdev(struct hdd_context *hdd_ctx)
 	}
 
 	priv = qdf_mem_malloc(sizeof(*priv));
-	if (!priv) {
-		hdd_err("pdev os obj create failed");
+	if (!priv)
 		return -ENOMEM;
-	}
 
 	reg_cap_ptr = ucfg_reg_get_hal_reg_cap(psoc);
 	if (!reg_cap_ptr) {

+ 6 - 9
core/hdd/src/wlan_hdd_ocb.c

@@ -1025,10 +1025,9 @@ static int __wlan_hdd_cfg80211_ocb_set_utc_time(struct wiphy *wiphy,
 	}
 
 	utc = qdf_mem_malloc(sizeof(*utc));
-	if (!utc) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!utc)
 		return -ENOMEM;
-	}
+
 	utc->vdev_id = adapter->vdev_id;
 	qdf_mem_copy(utc->utc_time, nla_data(utc_attr), SIZE_UTC_TIME);
 	qdf_mem_copy(utc->time_error, nla_data(time_error_attr),
@@ -1121,10 +1120,9 @@ __wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy,
 	}
 
 	timing_advert = qdf_mem_malloc(sizeof(*timing_advert));
-	if (!timing_advert) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!timing_advert)
 		return -ENOMEM;
-	}
+
 	timing_advert->vdev_id = adapter->vdev_id;
 
 	/* Parse the netlink message */
@@ -1251,10 +1249,9 @@ __wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy,
 	}
 
 	timing_advert = qdf_mem_malloc(sizeof(*timing_advert));
-	if (!timing_advert) {
-		hdd_err("qdf_mem_malloc failed");
+	if (!timing_advert)
 		return -ENOMEM;
-	}
+
 	timing_advert->vdev_id = adapter->vdev_id;
 
 	/* Parse the netlink message */

+ 3 - 6
core/hdd/src/wlan_hdd_oemdata.c

@@ -369,10 +369,8 @@ static QDF_STATUS oem_process_data_req_msg(int oem_data_len, char *oem_data)
 	qdf_mem_zero(&oem_data_req, sizeof(oem_data_req));
 
 	oem_data_req.data = qdf_mem_malloc(oem_data_len);
-	if (!oem_data_req.data) {
-		hdd_err("malloc failed for data req buffer");
+	if (!oem_data_req.data)
 		return QDF_STATUS_E_NOMEM;
-	}
 
 	oem_data_req.data_len = oem_data_len;
 	qdf_mem_copy(oem_data_req.data, oem_data, oem_data_len);
@@ -1166,10 +1164,9 @@ void hdd_oem_event_handler_cb(const struct oem_data *oem_event_data,
 		oem_data = osif_request_priv(request);
 		oem_data->data_len = oem_event_data->data_len;
 		oem_data->data = qdf_mem_malloc(oem_data->data_len);
-		if (!oem_data->data) {
-			hdd_err("Memory allocation failure");
+		if (!oem_data->data)
 			return;
-		}
+
 		qdf_mem_copy(oem_data->data, oem_event_data->data,
 			     oem_data->data_len);
 		oem_data->vdev_id = hdd_adapter->vdev_id;

+ 3 - 7
core/hdd/src/wlan_hdd_packet_filter.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -125,10 +125,8 @@ int wlan_hdd_set_filter(struct hdd_context *hdd_ctx,
 
 		pmo_set_pkt_fltr_req =
 			qdf_mem_malloc(sizeof(*pmo_set_pkt_fltr_req));
-		if (!pmo_set_pkt_fltr_req) {
-			hdd_err("unable to allocate pmo_set_pkt_fltr_req");
+		if (!pmo_set_pkt_fltr_req)
 			return QDF_STATUS_E_NOMEM;
-		}
 
 		pmo_set_pkt_fltr_req->filter_id = request->filter_id;
 		if (request->num_params >= HDD_MAX_CMP_PER_PACKET_FILTER) {
@@ -230,10 +228,8 @@ int wlan_hdd_set_filter(struct hdd_context *hdd_ctx,
 
 		pmo_clr_pkt_fltr_param = qdf_mem_malloc(
 					sizeof(*pmo_clr_pkt_fltr_param));
-		if (!pmo_clr_pkt_fltr_param) {
-			hdd_err("unable to allocate pmo_clr_pkt_fltr_param");
+		if (!pmo_clr_pkt_fltr_param)
 			return QDF_STATUS_E_NOMEM;
-		}
 
 		pmo_clr_pkt_fltr_param->filter_id = request->filter_id;
 		status = ucfg_pmo_clear_pkt_filter(hdd_ctx->psoc,

+ 1 - 3
core/hdd/src/wlan_hdd_regulatory.c

@@ -1282,10 +1282,8 @@ void hdd_send_wiphy_regd_sync_event(struct hdd_context *hdd_ctx)
 
 	regd = qdf_mem_malloc((reg_rules->num_of_reg_rules *
 				sizeof(*regd_rules) + sizeof(*regd)));
-	if (!regd) {
-		hdd_err("mem alloc failed for reg rules");
+	if (!regd)
 		return;
-	}
 
 	regd->n_reg_rules = reg_rules->num_of_reg_rules;
 	qdf_mem_copy(regd->alpha2, reg_rules->alpha2, REG_ALPHA2_LEN + 1);

+ 2 - 3
core/hdd/src/wlan_hdd_sap_cond_chan_switch.c

@@ -278,10 +278,9 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx,
 	 */
 	pre_cac_adapter->session.ap.beacon = qdf_mem_malloc(
 			sizeof(*ap_adapter->session.ap.beacon));
-	if (!pre_cac_adapter->session.ap.beacon) {
-		hdd_err("failed to alloc mem for beacon");
+	if (!pre_cac_adapter->session.ap.beacon)
 		goto stop_close_pre_cac_adapter;
-	}
+
 	qdf_mem_copy(pre_cac_adapter->session.ap.beacon,
 		     ap_adapter->session.ap.beacon,
 		     sizeof(*pre_cac_adapter->session.ap.beacon));

+ 1 - 3
core/hdd/src/wlan_hdd_sar_limits.c

@@ -706,10 +706,8 @@ static int __wlan_hdd_set_sar_power_limits(struct wiphy *wiphy,
 		goto send_sar_limits;
 
 	row = qdf_mem_malloc(sizeof(*row) * num_limit_rows);
-	if (!row) {
-		hdd_err("Failed to allocate memory for sar_limit_row_list");
+	if (!row)
 		goto fail;
-	}
 
 	sar_limit_cmd->num_limit_rows = num_limit_rows;
 	sar_limit_cmd->sar_limit_row_list = row;

+ 5 - 11
core/hdd/src/wlan_hdd_wext.c

@@ -2934,10 +2934,8 @@ void *mem_alloc_copy_from_user_helper(const __user void *wrqu_data, size_t len)
 	}
 
 	ptr = qdf_mem_malloc(len + 1);
-	if (!ptr) {
-		hdd_err("unable to allocate memory");
+	if (!ptr)
 		return NULL;
-	}
 
 	if (copy_from_user(ptr, wrqu_data, len)) {
 		hdd_err("failed to copy data to user buffer");
@@ -5338,10 +5336,8 @@ static int __iw_setnone_getint(struct net_device *dev,
 		return ret;
 
 	sme_config = qdf_mem_malloc(sizeof(*sme_config));
-	if (!sme_config) {
-		hdd_err("failed to allocate memory for sme_config");
+	if (!sme_config)
 		return -ENOMEM;
-	}
 
 	mac_handle = hdd_ctx->mac_handle;
 	switch (value[0]) {
@@ -5843,10 +5839,9 @@ static int hdd_set_fwtest(int argc, int cmd, int value)
 		return -EINVAL;
 	}
 	fw_test = qdf_mem_malloc(sizeof(*fw_test));
-	if (!fw_test) {
-		hdd_err("qdf_mem_malloc failed for fw_test");
+	if (!fw_test)
 		return -ENOMEM;
-	}
+
 	fw_test->arg = cmd;
 	fw_test->value = value;
 	if (QDF_STATUS_SUCCESS != sme_set_fw_test(fw_test)) {
@@ -6394,7 +6389,6 @@ static int __iw_get_char_setnone(struct net_device *dev,
 
 		sme_config = qdf_mem_malloc(sizeof(*sme_config));
 		if (!sme_config) {
-			hdd_err("Out of memory");
 			ret = -ENOMEM;
 			break;
 		}
@@ -8516,10 +8510,10 @@ static int __iw_set_pno(struct net_device *dev,
 	len = (wrqu->data.length + 1);
 	data = qdf_mem_malloc(len);
 	if (!data) {
-		hdd_err("fail to allocate memory %zu", len);
 		ret = -EINVAL;
 		goto exit;
 	}
+
 	qdf_mem_copy(data, extra, (len-1));
 	ptr = data;
 

+ 0 - 3
core/hdd/src/wlan_hdd_wmm.c

@@ -2136,8 +2136,6 @@ QDF_STATUS hdd_wmm_acquire_access(struct hdd_adapter *adapter,
 		/* no memory for QoS context.  Nothing we can do but
 		 * let data flow
 		 */
-		QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
-			  "%s: Unable to allocate context", __func__);
 		adapter->hdd_wmm_status.ac_status[ac_type].is_access_allowed =
 			true;
 		*granted = true;
@@ -2539,7 +2537,6 @@ hdd_wlan_wmm_status_e hdd_wmm_addts(struct hdd_adapter *adapter,
 	qos_context = qdf_mem_malloc(sizeof(*qos_context));
 	if (!qos_context) {
 		/* no memory for QoS context.  Nothing we can do */
-		hdd_err("Unable to allocate QoS context");
 		return HDD_WLAN_WMM_STATUS_INTERNAL_FAILURE;
 	}
 	/* we assume the tspec has already been validated by the caller */

+ 1 - 3
core/hdd/src/wlan_hdd_wowl.c

@@ -216,10 +216,8 @@ bool hdd_add_wowl_ptrn(struct hdd_adapter *adapter, const char *ptrn)
 
 		/* All is good. Store the pattern locally */
 		g_hdd_wowl_ptrns[empty_slot] = qdf_mem_malloc(len + 1);
-		if (!g_hdd_wowl_ptrns[empty_slot]) {
-			hdd_err("memory allocation failure");
+		if (!g_hdd_wowl_ptrns[empty_slot])
 			return false;
-		}
 
 		memcpy(g_hdd_wowl_ptrns[empty_slot], temp, len);
 		g_hdd_wowl_ptrns[empty_slot][len] = '\0';