Преглед на файлове

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 години
родител
ревизия
e2feccee66
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  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) 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>
 #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);
 	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);
 		mutex_unlock(&ipa3_qmi_lock);
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}