qcacld-3.0: Fix session can't be closed issue

There is race condition for a small window. The scenario
as below.

1 SAP is starting, and dfs cac begins but without finished.
2 SSR happens, wlan begins to call hdd_reset_all_adapters.
  In hdd_reset_all_adapters, sap_ctx->sessionId is reset to invalid.
3 In hdd_hostapd_sap_event_cb, adapter sessionId is set to
  sap_ctx->sessionId, after this step, adapter sessionId is changed
  from valid sessionId to 0xff.
  In hdd_reset_all_adapters->hdd_vdev_destroy, vdev is released
  but session can't be clean up as invalid sessionId. adapter->event_flags
  can't be clear which cause hdd_vdev_destroy can be called multi times.

Change as below.
1 cancel cac timer at the beginning of hdd_reset_all_adapters and
  before wlansap_set_invalid_session.
2 before send eSAP_START_BSS_EVENT, check if sap_ctx->sessionId
  is valid.

Change-Id: Ifaad62cd008f7769b059f36530455d4e734522e4
CRs-Fixed: 2293072
2 files changed