|
@@ -1151,18 +1151,18 @@ QDF_STATUS tdls_delete_all_tdls_peers(struct wlan_objmgr_vdev *vdev,
|
|
|
struct scheduler_msg msg = {0};
|
|
|
QDF_STATUS status;
|
|
|
|
|
|
+ peer = wlan_vdev_get_bsspeer(vdev);
|
|
|
+ if (!peer)
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
|
|
|
- del_msg = qdf_mem_malloc(sizeof(*del_msg));
|
|
|
- if (NULL == del_msg) {
|
|
|
- tdls_err("memory alloc failed");
|
|
|
+ if (QDF_STATUS_SUCCESS !=
|
|
|
+ wlan_objmgr_peer_try_get_ref(peer, WLAN_TDLS_SB_ID))
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
- }
|
|
|
- qdf_mem_zero(del_msg, sizeof(*del_msg));
|
|
|
|
|
|
- peer = wlan_vdev_get_bsspeer(vdev);
|
|
|
- if (QDF_STATUS_SUCCESS != wlan_objmgr_peer_try_get_ref(peer,
|
|
|
- WLAN_TDLS_SB_ID)) {
|
|
|
- qdf_mem_free(del_msg);
|
|
|
+ del_msg = qdf_mem_malloc(sizeof(*del_msg));
|
|
|
+ if (!del_msg) {
|
|
|
+ tdls_err("memory alloc failed");
|
|
|
+ wlan_objmgr_peer_release_ref(peer, WLAN_TDLS_SB_ID);
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|