mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
qcacmn: Fix potential resource leak when post msg in TDLS
Fix potentail memory leak when post message in TDLS module: 1. Add flush callback to hanlde memory free and release reference count; 2. Check the return status when post message and free the resource for failure case. Change-Id: I0a693ccb5704509a4220f26e024ce8c6c823890c CRs-Fixed: 2341652
This commit is contained in:
parent
30f5fabfd5
commit
de6fc0aa11
1 changed files with 2 additions and 32 deletions
|
|
@ -128,16 +128,6 @@ void hdd_notify_tdls_reset_adapter(struct wlan_objmgr_vdev *vdev)
|
|||
ucfg_tdls_notify_reset_adapter(vdev);
|
||||
}
|
||||
|
||||
static void hdd_notify_sta_connect_callback(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
if (!vdev) {
|
||||
cfg80211_err("vdev is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_TDLS_NB_ID);
|
||||
}
|
||||
|
||||
void
|
||||
hdd_notify_sta_connect(uint8_t session_id,
|
||||
bool tdls_chan_swit_prohibited,
|
||||
|
|
@ -161,22 +151,7 @@ hdd_notify_sta_connect(uint8_t session_id,
|
|||
notify_info.vdev = vdev;
|
||||
notify_info.tdls_chan_swit_prohibited = tdls_chan_swit_prohibited;
|
||||
notify_info.tdls_prohibited = tdls_prohibited;
|
||||
notify_info.callback = hdd_notify_sta_connect_callback;
|
||||
status = ucfg_tdls_notify_sta_connect(¬ify_info);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
cfg80211_err("ucfg_tdls_notify_sta_connect failed");
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_TDLS_NB_ID);
|
||||
}
|
||||
}
|
||||
|
||||
static void hdd_notify_sta_disconnect_callback(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
if (!vdev) {
|
||||
cfg80211_err("vdev is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_TDLS_NB_ID);
|
||||
ucfg_tdls_notify_sta_connect(¬ify_info);
|
||||
}
|
||||
|
||||
void hdd_notify_sta_disconnect(uint8_t session_id,
|
||||
|
|
@ -204,12 +179,7 @@ void hdd_notify_sta_disconnect(uint8_t session_id,
|
|||
notify_info.tdls_prohibited = false;
|
||||
notify_info.vdev = vdev;
|
||||
notify_info.user_disconnect = user_disconnect;
|
||||
notify_info.callback = hdd_notify_sta_disconnect_callback;
|
||||
status = ucfg_tdls_notify_sta_disconnect(¬ify_info);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
cfg80211_err("ucfg_tdls_notify_sta_disconnect failed");
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_TDLS_NB_ID);
|
||||
}
|
||||
ucfg_tdls_notify_sta_disconnect(¬ify_info);
|
||||
}
|
||||
int wlan_cfg80211_tdls_add_peer(struct wlan_objmgr_pdev *pdev,
|
||||
struct net_device *dev, const uint8_t *mac)
|
||||
|
|
|
|||
Loading…
Reference in a new issue