IPACM: fix the ipacm crash issue on SSR
On SSR scenario without tethering enable once,
ipacm crash due to uninitialized pointer,
elrInstance. Make the change to initialize it
as NULL
Test: Verified force modem SSR and ipacm didn't crash
Verified basic data and tethering use cases
Bug: 67019241
CRs-Fixed: 2132095
Change-Id: I126f44c02a8b186dd2e61392cb2d9732263165e1
diff --git a/msm8998/ipacm/src/IPACM_Main.cpp b/msm8998/ipacm/src/IPACM_Main.cpp
index 13cdb51..62dc596 100644
--- a/msm8998/ipacm/src/IPACM_Main.cpp
+++ b/msm8998/ipacm/src/IPACM_Main.cpp
@@ -694,6 +694,7 @@
if (OffloadMng->elrInstance == NULL) {
IPACMERR("OffloadMng->elrInstance is NULL, can't forward to framework!\n");
} else {
+ IPACMERR("calling OffloadMng->elrInstance->onLimitReached \n");
OffloadMng->elrInstance->onLimitReached();
}
continue;
@@ -703,6 +704,7 @@
if (OffloadMng->elrInstance == NULL) {
IPACMERR("OffloadMng->elrInstance is NULL, can't forward to framework!\n");
} else {
+ IPACMERR("calling OffloadMng->elrInstance->onOffloadStopped \n");
OffloadMng->elrInstance->onOffloadStopped(IpaEventRelay::ERROR);
}
continue;
@@ -712,6 +714,7 @@
if (OffloadMng->elrInstance == NULL) {
IPACMERR("OffloadMng->elrInstance is NULL, can't forward to framework!\n");
} else {
+ IPACMERR("calling OffloadMng->elrInstance->onOffloadSupportAvailable \n");
OffloadMng->elrInstance->onOffloadSupportAvailable();
}
continue;
diff --git a/msm8998/ipacm/src/IPACM_OffloadManager.cpp b/msm8998/ipacm/src/IPACM_OffloadManager.cpp
index 2061fd2..4010e72 100644
--- a/msm8998/ipacm/src/IPACM_OffloadManager.cpp
+++ b/msm8998/ipacm/src/IPACM_OffloadManager.cpp
@@ -59,6 +59,8 @@
upstream_v6_up = false;
memset(event_cache, 0, MAX_EVENT_CACHE*sizeof(framework_event_cache));
latest_cache_index = 0;
+ elrInstance = NULL;
+ touInstance = NULL;
return ;
}