Browse Source

qcacmn: Acquire spinlock before taking ref for scan_db entry

Locks must be taken before accessing scan_db nodes to ensure
reference counts are not changed while changing entries within
the node or while freeing the node.

Ensure that a spinlock is used before increasing the reference
count to make sure that there is no other execution context
accessing the scan_db.

CRs-Fixed: 2791279
Change-Id: I4402ff15de7c8d4fc31009f7307ba262b4df6702
Aditya Sathish 4 năm trước cách đây
mục cha
commit
309120eac2
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      umac/scan/core/src/wlan_scan_cache_db.c

+ 2 - 0
umac/scan/core/src/wlan_scan_cache_db.c

@@ -535,8 +535,10 @@ static QDF_STATUS scm_flush_oldest_entry(struct scan_dbs *scan_db)
 					scm_scan_entry_put_ref(scan_db,
 							       oldest_node,
 							       true);
+				qdf_spin_lock_bh(&scan_db->scan_db_lock);
 				oldest_node = cur_node;
 				scm_scan_entry_get_ref(oldest_node);
+				qdf_spin_lock_bh(&scan_db->scan_db_lock);
 			}
 
 			cur_node = scm_get_next_node(scan_db,