Browse Source

qcacld-3.0: Decrement vdev ref count in wma_state_info_dump

Vdev ref count is incremented in wma_state_info_dump
and not decremented before return. This results in
vdev not deleted physically as part of wlan0 hdd_stop.
On hdd_open, a new vdev is created for wlan0 with same
mac addr as the previous wlan0 vdev. In scan, API to
get vdev by mac addr will return NULL since the first
wlan0 vdev is not physically deleted and not removed from
vdev list.

Fix is to decrement vdev ref count in wma_state_info_dump.

Change-Id: I67c90a721643f5bb7c6e212846f6d398055a6672
CRs-Fixed: 2233997
Yeshwanth Sriram Guntuka 7 years ago
parent
commit
0e6f44655a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      core/wma/src/wma_main.c

+ 3 - 0
core/wma/src/wma_main.c

@@ -2092,6 +2092,8 @@ static void wma_state_info_dump(char **buf_ptr, uint16_t *size)
 
 		vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc,
 						vdev_id, WLAN_LEGACY_WMA_ID);
+		if (vdev == NULL)
+			continue;
 		ucfg_mc_cp_stats_get_vdev_wake_lock_stats(vdev, &stats);
 		len += qdf_scnprintf(buf + len, *size - len,
 			"\n"
@@ -2166,6 +2168,7 @@ static void wma_state_info_dump(char **buf_ptr, uint16_t *size)
 			iface->chain_mask,
 			iface->nss_2g,
 			iface->nss_5g);
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
 	}
 
 	*size -= len;