Ver Fonte

qcacld-3.0: Remove redundant mem zero after malloc in HDD

Remove redundant qdf_mem_zero after qdf_mem_malloc since output
of qdf_mem_malloc already gives zeroed memory[i.e. kzalloc].

Change-Id: I3190e56ad7b8c12c4dc8357b1e1238e04f651d6a
CRs-Fixed: 1079659
Selvaraj, Sridhar há 8 anos atrás
pai
commit
af90144173

+ 0 - 1
core/hdd/src/wlan_hdd_cfg.c

@@ -6876,7 +6876,6 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
 			  "%s: unable to allocate smeConfig", __func__);
 		return QDF_STATUS_E_NOMEM;
 	}
-	qdf_mem_zero(smeConfig, sizeof(*smeConfig));
 
 	QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH,
 		  "%s bWmmIsEnabled=%d 802_11e_enabled=%d dot11Mode=%d",

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

@@ -6465,7 +6465,6 @@ static int hdd_set_reset_bpf_offload(hdd_context_t *hdd_ctx,
 		hdd_err("qdf_mem_malloc failed for bpf_set_offload");
 		return -ENOMEM;
 	}
-	qdf_mem_zero(bpf_set_offload, sizeof(*bpf_set_offload));
 
 	/* Parse and fetch bpf packet size */
 	if (!tb[BPF_PACKET_SIZE]) {
@@ -9215,7 +9214,6 @@ static void wlan_hdd_set_dhcp_server_offload(hdd_adapter_t *pHostapdAdapter)
 		hdd_err("could not allocate tDhcpSrvOffloadInfo!");
 		return;
 	}
-	qdf_mem_zero(pDhcpSrvInfo, sizeof(*pDhcpSrvInfo));
 	pDhcpSrvInfo->vdev_id = pHostapdAdapter->sessionId;
 	pDhcpSrvInfo->dhcpSrvOffloadEnabled = true;
 	pDhcpSrvInfo->dhcpClientNum = pHddCtx->config->dhcpMaxNumClients;
@@ -11482,7 +11480,6 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
 					eConnectionState_NotConnected);
 			return -ENOMEM;
 		}
-		qdf_mem_zero(sme_config, sizeof(*sme_config));
 		sme_get_config_param(pHddCtx->hHal, sme_config);
 		/* These values are not sessionized. So, any change in these SME
 		 * configs on an older or parallel interface will affect the

+ 0 - 1
core/hdd/src/wlan_hdd_ext_scan.c

@@ -3894,7 +3894,6 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
 		hdd_err("qdf_mem_malloc failed");
 		return -ENOMEM;
 	}
-	qdf_mem_zero(req_msg, len);
 	req_msg->num_networks = num_networks;
 
 	/* Parse and fetch request Id */

+ 0 - 1
core/hdd/src/wlan_hdd_green_ap.c

@@ -315,7 +315,6 @@ static QDF_STATUS hdd_green_ap_attach(struct hdd_context_s *hdd_ctx)
 		goto error;
 	}
 
-	qdf_mem_zero(green_ap, sizeof(*green_ap));
 	green_ap->ps_state = GREEN_AP_PS_OFF_STATE;
 	green_ap->ps_event = 0;
 	green_ap->num_nodes = 0;

+ 0 - 1
core/hdd/src/wlan_hdd_hostapd.c

@@ -1532,7 +1532,6 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 				hdd_err("Failed to allocate station info");
 				return QDF_STATUS_E_FAILURE;
 			}
-			memset(sta_info, 0, sizeof(*sta_info));
 			if (iesLen <= MAX_ASSOC_IND_IE_LEN) {
 				sta_info->assoc_req_ies =
 					(const u8 *)&pSapEvent->sapevt.

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

@@ -1162,7 +1162,6 @@ hdd_sendactionframe(hdd_adapter_t *adapter, const uint8_t *bssid,
 		ret = -ENOMEM;
 		goto exit;
 	}
-	qdf_mem_zero(frame, frame_len);
 
 	hdr = (struct ieee80211_hdr_3addr *)frame;
 	hdr->frame_control =
@@ -2819,7 +2818,6 @@ static int hdd_parse_get_cckm_ie(uint8_t *pValue, uint8_t **pCckmIe,
 		hdd_err("qdf_mem_malloc failed");
 		return -ENOMEM;
 	}
-	qdf_mem_zero(*pCckmIe, (*pCckmIeLen + 1) / 2);
 	/*
 	 * the buffer received from the upper layer is character buffer,
 	 * we need to prepare the buffer taking 2 characters in to a U8 hex
@@ -4854,7 +4852,6 @@ static int drv_cmd_set_ibss_beacon_oui_data(hdd_adapter_t *adapter,
 		ret = -ENOMEM;
 		goto exit;
 	}
-	qdf_mem_zero(ibss_ie, command_len);
 
 	ibss_ie_length = hdd_parse_set_ibss_oui_data_command(value, ibss_ie,
 							     &oui_length,

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

@@ -6894,8 +6894,6 @@ static int hdd_update_cds_config(hdd_context_t *hdd_ctx)
 		return -ENOMEM;
 	}
 
-	qdf_mem_zero(cds_cfg, sizeof(*cds_cfg));
-
 	/* UMA is supported in hardware for performing the
 	 * frame translation 802.11 <-> 802.3
 	 */

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

@@ -325,7 +325,6 @@ static struct sir_ocb_config *hdd_ocb_config_new(int num_channels,
 	if (!cursor)
 		goto fail;
 
-	qdf_mem_zero(cursor, len);
 	ret = cursor;
 	cursor += sizeof(*ret);
 
@@ -1121,7 +1120,6 @@ __wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy,
 		hdd_err("qdf_mem_malloc failed");
 		return -ENOMEM;
 	}
-	qdf_mem_zero(timing_advert, sizeof(*timing_advert));
 	timing_advert->vdev_id = adapter->sessionId;
 
 	/* Parse the netlink message */
@@ -1239,7 +1237,6 @@ __wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy,
 		hdd_err("qdf_mem_malloc failed");
 		return -ENOMEM;
 	}
-	qdf_mem_zero(timing_advert, sizeof(sizeof(*timing_advert)));
 	timing_advert->vdev_id = adapter->sessionId;
 
 	/* Parse the netlink message */

+ 0 - 1
core/hdd/src/wlan_hdd_p2p.c

@@ -823,7 +823,6 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy,
 		return -ENOMEM;
 	}
 
-	qdf_mem_zero(pRemainChanCtx, sizeof(*pRemainChanCtx));
 	qdf_mem_copy(&pRemainChanCtx->chan, chan,
 		     sizeof(struct ieee80211_channel));
 	pRemainChanCtx->duration = duration;

+ 0 - 1
core/hdd/src/wlan_hdd_power.c

@@ -1057,7 +1057,6 @@ void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set)
 		hdd_err("Could not allocate Memory");
 		return;
 	}
-	qdf_mem_zero(pMulticastAddrs, sizeof(tSirRcvFltMcAddrList));
 	pMulticastAddrs->action = set;
 
 	if (set) {

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

@@ -2263,7 +2263,6 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
 		return -ENOMEM;
 	}
 
-	memset(pPnoRequest, 0, sizeof(tSirPNOScanReq));
 	pPnoRequest->enable = 1;        /*Enable PNO */
 	pPnoRequest->ucNetworksCount = request->n_match_sets;
 
@@ -2534,7 +2533,6 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
 		return -ENOMEM;
 	}
 
-	memset(pPnoRequest, 0, sizeof(tSirPNOScanReq));
 	pPnoRequest->enable = 0;        /* Disable PNO */
 	pPnoRequest->ucNetworksCount = 0;
 

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

@@ -741,8 +741,6 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter)
 			hdd_err("malloc failed!");
 			return -ENOMEM;
 		}
-		/* initialize TDLS pAdater context */
-		qdf_mem_zero(pHddTdlsCtx, sizeof(tdlsCtx_t));
 
 		/* Initialize connection tracker timer */
 		qdf_mc_timer_init(&pHddTdlsCtx->peer_update_timer,
@@ -1023,7 +1021,6 @@ hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, const u8 *mac,
 	key = wlan_hdd_tdls_hash_key(mac);
 	head = &pHddTdlsCtx->peer_list[key];
 
-	qdf_mem_zero(peer, sizeof(hddTdlsPeer_t));
 	qdf_mem_copy(peer->peerMac, mac, sizeof(peer->peerMac));
 	peer->pHddTdlsCtx = pHddTdlsCtx;
 	peer->pref_off_chan_num = pHddCtx->config->fTDLSPrefOffChanNum;