msm: ipa3: Added fix to avoid the sys pointer null dereference
When we failed to setup the wan pipes, we will make apps_to_ipa3
hdl to 0, so in subsequent teardown, ep hdl passed will be 0, if ep 0 is
not setup, we will access a null sys, so to avoid that, we have
added apps_to_ipa3_hdl value checker in setup_sys like if it is -1
then only we are assigning it to 0, other wise it's value won't change,
so that in teardown, it won't access a invalid ep hdl or sys.
Change-Id: I9a8e11815f7a397fbc1a0c809711fda618dab7d1
Signed-off-by: Shiva Ganesh <quic_shivgane@quicinc.com>
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
index d7a09a8..b3d0c05 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
@@ -1454,7 +1454,10 @@
goto fail_gen;
}
- *clnt_hdl = 0;
+ /*checking for clnt_hdl having any previously updated
+ value or not, if not then assigning 0 */
+ if(*clnt_hdl == -1)
+ *clnt_hdl = 0;
if (sys_in->client >= IPA_CLIENT_MAX || sys_in->desc_fifo_sz == 0) {
IPAERR("bad parm client:%d fifo_sz:%d\n",