Browse Source

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 <[email protected]>
Signed-off-by: Pavan Kumar M <[email protected]>
Veerendra Kumar Kamsali 2 years ago
parent
commit
e2feccee66
1 changed files with 3 additions and 3 deletions
  1. 3 3
      drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c

+ 3 - 3
drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c

@@ -2,7 +2,7 @@
 /*
  * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
  *
- * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/module.h>
@@ -555,8 +555,8 @@ static int ipa3_qmi_send_req_wait(struct qmi_handle *client_handle,
 
 	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;
 	}