diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 6857257662bd..e1fbf6a37df3 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -3182,6 +3182,9 @@ static void dp_vdev_detach_wifi3(struct cdp_vdev *vdev_handle, /* remove the vdev from its parent pdev's list */ TAILQ_REMOVE(&pdev->vdev_list, vdev, vdev_list_elem); + if (wlan_op_mode_sta == vdev->opmode) + dp_peer_delete_wifi3(vdev->vap_bss_peer, 0); + /* * Use peer_ref_mutex while accessing peer_list, in case * a peer is in the process of being removed from the list. @@ -3209,9 +3212,6 @@ static void dp_vdev_detach_wifi3(struct cdp_vdev *vdev_handle, QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH, FL("deleting vdev object %pK (%pM)"), vdev, vdev->mac_addr.raw); - if (wlan_op_mode_sta == vdev->opmode) - dp_peer_delete_wifi3(vdev->vap_bss_peer, 0); - qdf_mem_free(vdev); if (callback)