summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanumantha Reddy Pothula <c_hpothu@qti.qualcomm.com>2015-02-24 14:24:55 -0800
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2015-03-02 17:11:25 +0530
commit9b9475d3b5908f3e1a8c758e680ddf836570bf2e (patch)
treeadb5b78db3d59ed6c158dff2d0fc7726bf17e3f4
parentbefb05f934226f4476d7d23b7438d711e85d6544 (diff)
qcacld-2.0: validate QOS context before updating status
This is prima to qcacld-2.0 propagation. There is a possibility of updating lastStatus in QOS context after QOS context is freed. Hence validate QOS context by checking magic number before updating lastStatus. Change-Id: I182d0008206471e2cbf7695e3461931b1e2f3f5d CRs-Fixed: 799671
-rw-r--r--CORE/HDD/src/wlan_hdd_wmm.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/CORE/HDD/src/wlan_hdd_wmm.c b/CORE/HDD/src/wlan_hdd_wmm.c
index ce5dfc0869f9..629cba6522d1 100644
--- a/CORE/HDD/src/wlan_hdd_wmm.c
+++ b/CORE/HDD/src/wlan_hdd_wmm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -2453,8 +2453,12 @@ hdd_wlan_wmm_status_e hdd_wmm_addts( hdd_adapter_t* pAdapter,
return HDD_WLAN_WMM_STATUS_MODIFY_FAILED;
}
- // we were successful, save the status
- pQosContext->lastStatus = status;
+ /* we were successful, save the status */
+ mutex_lock(&pAdapter->hddWmmStatus.wmmLock);
+ if (pQosContext->magic == HDD_WMM_CTX_MAGIC)
+ pQosContext->lastStatus = status;
+ mutex_unlock(&pAdapter->hddWmmStatus.wmmLock);
+
return status;
}
@@ -2542,8 +2546,11 @@ hdd_wlan_wmm_status_e hdd_wmm_addts( hdd_adapter_t* pAdapter,
}
#endif
- // we were successful, save the status
- pQosContext->lastStatus = status;
+ /* we were successful, save the status */
+ mutex_lock(&pAdapter->hddWmmStatus.wmmLock);
+ if (pQosContext->magic == HDD_WMM_CTX_MAGIC)
+ pQosContext->lastStatus = status;
+ mutex_unlock(&pAdapter->hddWmmStatus.wmmLock);
return status;
}
@@ -2653,7 +2660,11 @@ hdd_wlan_wmm_status_e hdd_wmm_delts( hdd_adapter_t* pAdapter,
}
#endif
- pQosContext->lastStatus = status;
+ mutex_lock(&pAdapter->hddWmmStatus.wmmLock);
+ if (pQosContext->magic == HDD_WMM_CTX_MAGIC)
+ pQosContext->lastStatus = status;
+ mutex_unlock(&pAdapter->hddWmmStatus.wmmLock);
+
return status;
}