qcacld-2.0: Process channel change request only when SAP is started
When SAP starts (DFS channel) on default interface and a new interface
for SAP is created, if eSAP_DFS_CHANNEL_CAC_RADAR_FOUND event is
triggered then kernel panic happens. This is because for the new
interface SAP is created but not started and due to this channel list
is NULL. Fix is to add state check for SAP interface to know if SAP is
started or not.
Change-Id: If613ec3ed0afad8a66d545bcd858fe73640a0273
CRs-Fixed: 1062516
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index b035c65..1b979c5 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -4143,13 +4143,14 @@
for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++)
{
ptSapContext sapContext;
+ sapContext = pMac->sap.sapCtxList [intf].pSapContext;
if (((VOS_STA_SAP_MODE ==
pMac->sap.sapCtxList[intf].sapPersona) ||
(VOS_P2P_GO_MODE ==
pMac->sap.sapCtxList[intf].sapPersona)) &&
- pMac->sap.sapCtxList [intf].pSapContext != NULL)
+ sapContext != NULL &&
+ sapContext->sapsMachine != eSAP_DISCONNECTED)
{
- sapContext = pMac->sap.sapCtxList [intf].pSapContext;
/* SAP to be moved to DISCONNECTING state */
sapContext->sapsMachine = eSAP_DISCONNECTING;
/*