qcacld-3.0: fix possible race condition in hdd IPA

hdd_ipa->sta_connected in WLAN_CLIENT_DISCONNECT case is not under lock
protection and is prone to race conditions.

Fix is to release event_lock after checking sta_connected so as to avoid
possible race conditions.

Change-Id: I6206d5d0cc2cf5df02ab4caf0de810961da21006
CRs-Fixed: 2082525
This commit is contained in:
jiad 2017-07-28 14:05:31 +08:00 • committed by snandini
commit 9d472c9da0

View file

@ -5983,14 +5983,16 @@ static int __hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
hdd_ipa_uc_handle_last_discon(hdd_ipa);
}
qdf_mutex_release(&hdd_ipa->event_lock);
if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx) &&
hdd_ipa->sta_connected)
hdd_ipa->sta_connected) {
qdf_mutex_release(&hdd_ipa->event_lock);
hdd_ipa_uc_offload_enable_disable(
hdd_get_adapter(hdd_ipa->hdd_ctx,
QDF_STA_MODE),
SIR_STA_RX_DATA_OFFLOAD, false);
} else {
qdf_mutex_release(&hdd_ipa->event_lock);
}
} else {
qdf_mutex_release(&hdd_ipa->event_lock);
}