소스 검색

qcacmn: Fix NULL pointer dereference when out of buffers

When util_scan_copy_cache_entry return NULL for out of buffers,
NULL pointer dereference happens.

To fix it, check return pointer of util_scan_copy_cache_entry
before use it.

Change-Id: Iec5e6f10c8e0bbe6b88d844cc00320f3f23191a4
CRs-Fixed: 3885075
Jianmin Zhu 7 달 전
부모
커밋
ee88dcad93
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c

+ 5 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c

@@ -3020,6 +3020,11 @@ cm_add_11_ax_candidate(struct wlan_objmgr_pdev *pdev,
 	struct scan_cache_entry *tmp_scan_entry = NULL;
 
 	tmp_scan_entry = util_scan_copy_cache_entry(scan_entry->entry);
+	if (!tmp_scan_entry) {
+		mlme_err("Copy cache entry failed");
+		return;
+	}
+
 	/* Add 11AX entry for MLO Candidate */
 	if (!tmp_scan_entry->ie_list.multi_link_bv) {
 		util_scan_free_cache_entry(tmp_scan_entry);