msm: ipa3: adding a check to see if ipa_q6_clnt is NULL
Adding a check to see if ipa_q6_clnt is NULL or not in a
rare race conditions to avoid NULL pointer access.
Change-Id: I9b4348f752a2220256c1e58cf6ac299b6c1e3e2f
Signed-off-by: Veerendra Kumar Kamsali <quic_veekum@quicinc.com>
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c
index 49735eb..4551308 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c
@@ -553,8 +553,8 @@
mutex_lock(&ipa3_qmi_lock);
- if (client_handle != ipa_q6_clnt) {
- IPADBG("Q6 QMI clinet pointer already freed\n");
+ if (!client_handle || client_handle != ipa_q6_clnt ) {
+ IPADBG("Q6 QMI client pointer already freed\n");
mutex_unlock(&ipa3_qmi_lock);
return -EINVAL;
}