Эх сурвалжийг харах

qcacld-3.0: Allocate memory from heap to wma_set_stakey

This change I29209576622bc2495a7ce3064e82efca2e70d19a was to fix a
memory leak, but ibss creating peer pass a pointer on stack to
wma_set_stakey API, it makes a regression.

Fix it by passing all pointer from heap to wma_set_stakey API.

Change-Id: I178e4b6a15aa24faae78d9846427b3292d11a1a4
CRs-Fixed: 2455529
Will Huang 5 жил өмнө
parent
commit
f108e02f54

+ 10 - 6
core/wma/src/wma_dev_if.c

@@ -2080,17 +2080,21 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
 	/* for each remote ibss peer, clear its keys */
 	if (wma_is_vdev_in_ibss_mode(wma, vdev_id) &&
 	    qdf_mem_cmp(peer_addr, mac_addr_raw, QDF_MAC_ADDR_SIZE)) {
-		tSetStaKeyParams key_info;
+		tpSetStaKeyParams key_info;
 
+		key_info = qdf_mem_malloc(sizeof(*key_info));
+		if (!key_info) {
+			return QDF_STATUS_E_NOMEM;
+		}
 		WMA_LOGD("%s: remote ibss peer %pM key clearing\n", __func__,
 			 peer_addr);
-		qdf_mem_zero(&key_info, sizeof(key_info));
-		key_info.smesessionId = vdev_id;
-		qdf_mem_copy(key_info.peer_macaddr.bytes, peer_addr,
+		qdf_mem_zero(key_info, sizeof(*key_info));
+		key_info->smesessionId = vdev_id;
+		qdf_mem_copy(key_info->peer_macaddr.bytes, peer_addr,
 				QDF_MAC_ADDR_SIZE);
-		key_info.sendRsp = false;
+		key_info->sendRsp = false;
 
-		wma_set_stakey(wma, &key_info);
+		wma_set_stakey(wma, key_info);
 	}
 
 	return QDF_STATUS_SUCCESS;