فهرست منبع

qcacmn: Fix the pointer reset in cm_allocate_and_copy_ies_and_keys

In cm_allocate_and_copy_ies_and_keys instead of target's pointer
source's pointers are reset thus making the following code void

Fix this by resetting the target pointers which needs to be allocated
with new memory.

Change-Id: I4417492c43eb27833d365ec4aa644e07ed4eca51
CRs-fixed: 2884187
gaurank kathpalia 4 سال پیش
والد
کامیت
fffe13cbc9
2فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 1 1
      os_if/linux/mlme/src/osif_cm_req.c
  2. 4 4
      umac/mlme/connection_mgr/core/src/wlan_cm_connect.c

+ 1 - 1
os_if/linux/mlme/src/osif_cm_req.c

@@ -419,7 +419,7 @@ static void osif_cm_free_connect_req(struct wlan_cm_connect_req *connect_req)
 {
 	if (connect_req->scan_ie.ptr) {
 		qdf_mem_free(connect_req->scan_ie.ptr);
-		connect_req->assoc_ie.ptr = NULL;
+		connect_req->scan_ie.ptr = NULL;
 	}
 
 	if (connect_req->assoc_ie.ptr) {

+ 4 - 4
umac/mlme/connection_mgr/core/src/wlan_cm_connect.c

@@ -1830,10 +1830,10 @@ cm_allocate_and_copy_ies_and_keys(struct wlan_cm_connect_req *target,
 				  struct wlan_cm_connect_req *source)
 {
 	/* Reset the copied pointers of target */
-	source->assoc_ie.ptr = NULL;
-	source->crypto.wep_keys.key = NULL;
-	source->crypto.wep_keys.seq = NULL;
-	source->scan_ie.ptr = NULL;
+	target->assoc_ie.ptr = NULL;
+	target->crypto.wep_keys.key = NULL;
+	target->crypto.wep_keys.seq = NULL;
+	target->scan_ie.ptr = NULL;
 
 	if (source->scan_ie.ptr) {
 		target->scan_ie.ptr = qdf_mem_malloc(source->scan_ie.len);