summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCNSS_WLAN Service <cnssbldsw@qualcomm.com>2017-06-08 23:20:25 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-06-08 23:20:25 -0700
commit32db02b53f795f32cbf40c8827425dbfe13e43d8 (patch)
tree648ae598f1e5fac922b1738013a1e1a746594980
parentb3d105f236eb768950b906fa4342fb7fb31f1b6f (diff)
parentac7fb9d6df5a5463c945dbcd3975daf2c3fa6ae7 (diff)
Merge "qcacld-2.0: Fix fragile code in dphInitStaState" into wlan-cld2.driver.lnx.1.0-dev
-rw-r--r--CORE/MAC/src/dph/dphHashTable.c16
-rw-r--r--CORE/MAC/src/include/dphGlobal.h17
-rw-r--r--CORE/MAC/src/pe/lim/limProcessTdls.c7
3 files changed, 16 insertions, 24 deletions
diff --git a/CORE/MAC/src/dph/dphHashTable.c b/CORE/MAC/src/dph/dphHashTable.c
index 383fb49e1272..ab5fb311a7d1 100644
--- a/CORE/MAC/src/dph/dphHashTable.c
+++ b/CORE/MAC/src/dph/dphHashTable.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2014, 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014, 2016-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -248,7 +248,7 @@ tpDphHashNode dphInitStaState(tpAniSirGlobal pMac, tSirMacAddr staAddr,
{
tANI_U32 val;
- tpDphHashNode pStaDs;
+ tpDphHashNode pStaDs, pnext;
tANI_U16 staIdx = HAL_STA_INVALID_IDX;
if (assocId >= pDphHashTable->size)
@@ -259,23 +259,25 @@ tpDphHashNode dphInitStaState(tpAniSirGlobal pMac, tSirMacAddr staAddr,
pStaDs = getNode(pMac, (tANI_U8) assocId, pDphHashTable);
staIdx = pStaDs->staIndex;
+ pnext = pStaDs->next;
PELOG1(limLog(pMac, LOG1, FL("Assoc Id %d, Addr %p"), assocId, &pStaDs);)
- // Clear the STA node except for the next pointer (last 4 bytes)
- vos_mem_set( (tANI_U8 *) pStaDs, sizeof(tDphHashNode) - sizeof(tpDphHashNode), 0);
+ /* Clear the STA node except for the next pointer */
+ vos_mem_set((tANI_U8 *)pStaDs, sizeof(tDphHashNode), 0);
+ pStaDs->next = pnext;
- // Initialize the assocId
+ /* Initialize the assocId */
pStaDs->assocId = assocId;
if(true == validStaIdx)
pStaDs->staIndex = staIdx;
else
pStaDs->staIndex = HAL_STA_INVALID_IDX;
- // Initialize STA mac address
+ /* Initialize STA mac address */
vos_mem_copy( pStaDs->staAddr, staAddr, sizeof(tSirMacAddr));
- // Initialize fragmentation threshold
+ /* Initialize fragmentation threshold */
if (wlan_cfgGetInt(pMac, WNI_CFG_FRAGMENTATION_THRESHOLD, &val) != eSIR_SUCCESS)
limLog(pMac, LOGP, FL("could not retrieve fragmentation threshold"));
else
diff --git a/CORE/MAC/src/include/dphGlobal.h b/CORE/MAC/src/include/dphGlobal.h
index 056140debf81..4cd9bfc65647 100644
--- a/CORE/MAC/src/include/dphGlobal.h
+++ b/CORE/MAC/src/include/dphGlobal.h
@@ -501,23 +501,18 @@ typedef struct sDphHashNode
uint8_t nss;
- /* When a station with already an existing dph entry tries to
-
- * associate again, the old dph entry will be zeroed out except
-
- * for the next pointer. The next pointer must be defined at the
-
- * end of the structure.
-
- */
-
tANI_U8 isDisassocDeauthInProgress;
bool sta_deletion_in_progress;
tANI_S8 del_sta_ctx_rssi;
uint8_t sub20_dynamic_channelwidth;
/* Flag indicating connected STA doesn't support ECSA */
uint8_t non_ecsa_capable;
- /* DO NOT ADD NEW MEMBER AFTER MEMBER *next */
+
+ /* When a station with an existing dph entry tries to
+ * associate again, the old dph entry will be zeroed out except
+ * for the next pointer. The next pointer must be defined at the
+ * end of the structure.
+ */
struct sDphHashNode *next;
/* DO NOT ADD NEW MEMBER AFTER MEMBER *next */
} tDphHashNode, *tpDphHashNode;
diff --git a/CORE/MAC/src/pe/lim/limProcessTdls.c b/CORE/MAC/src/pe/lim/limProcessTdls.c
index a9aef2821230..a3e6a93aaa0e 100644
--- a/CORE/MAC/src/pe/lim/limProcessTdls.c
+++ b/CORE/MAC/src/pe/lim/limProcessTdls.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -2327,8 +2327,6 @@ static void limTdlsUpdateHashNodeInfo(tpAniSirGlobal pMac, tDphHashNode *pStaDs,
tDot11fIEVHTCaps vhtCap;
tANI_U8 cbMode;
#endif
- tpDphHashNode pSessStaDs = NULL;
- tANI_U16 aid;
if (pTdlsAddStaReq->tdlsAddOper == TDLS_OPER_ADD)
{
@@ -2428,9 +2426,6 @@ static void limTdlsUpdateHashNodeInfo(tpAniSirGlobal pMac, tDphHashNode *pStaDs,
#endif
}
- pSessStaDs = dphLookupHashEntry(pMac, psessionEntry->bssId, &aid,
- &psessionEntry->dph.dphHashTable) ;
-
/* Lets enable QOS parameter */
pStaDs->qosMode = (pTdlsAddStaReq->capability & CAPABILITIES_QOS_OFFSET)
|| pTdlsAddStaReq->htcap_present;