qcacmn: Get peer with ref count
wlan_vdev_get_bsspeer doesn't hold ref count on peer. Use wlan_objmgr_get_peer to get peer to avoid peer free race condition. Change-Id: I04bfcf8ca20fa49d81a9e59aafc31caab98374a1 CRs-Fixed: 2337868
This commit is contained in:

gecommit door
nshrivas

bovenliggende
f4547d9764
commit
77d877285a
@@ -365,7 +365,7 @@ static void tgt_mc_cp_stats_extract_vdev_summary_stats(
|
||||
{
|
||||
uint8_t i;
|
||||
QDF_STATUS status;
|
||||
struct wlan_objmgr_peer *peer;
|
||||
struct wlan_objmgr_peer *peer = NULL;
|
||||
struct request_info last_req = {0};
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
struct peer_mc_cp_stats *peer_mc_stats;
|
||||
@@ -416,9 +416,10 @@ static void tgt_mc_cp_stats_extract_vdev_summary_stats(
|
||||
sizeof(vdev_mc_stats->vdev_summary_stats));
|
||||
wlan_cp_stats_vdev_obj_unlock(vdev_cp_stats_priv);
|
||||
|
||||
peer = wlan_vdev_get_bsspeer(vdev);
|
||||
peer = wlan_objmgr_get_peer(psoc, last_req.pdev_id,
|
||||
last_req.peer_mac_addr, WLAN_CP_STATS_ID);
|
||||
if (!peer) {
|
||||
cp_stats_err("bsspeer is null");
|
||||
cp_stats_err("peer is null %pM", last_req.peer_mac_addr);
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -434,6 +435,8 @@ static void tgt_mc_cp_stats_extract_vdev_summary_stats(
|
||||
wlan_cp_stats_peer_obj_unlock(peer_cp_stats_priv);
|
||||
|
||||
end:
|
||||
if (peer)
|
||||
wlan_objmgr_peer_release_ref(peer, WLAN_CP_STATS_ID);
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_CP_STATS_ID);
|
||||
}
|
||||
|
||||
|
Verwijs in nieuw issue
Block a user