qcacld-3.0: Prevent memory issue with more check
Add session_id range check etc
Change-Id: I749076a5f060873702b42ac4908e3220e805c349
CRs-Fixed: 2061117
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index a2f59d5..3610b66 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -2641,7 +2641,11 @@
"Interface context is NULL");
return;
}
-
+ if (session_id >= CSR_ROAM_SESSION_MAX) {
+ HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
+ "invalid session id: %d", session_id);
+ return;
+ }
if (enable == hdd_ipa->vdev_offload_enabled[session_id]) {
/* IPA offload status is already set as desired */
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,