Browse Source

qcacmn: Avoid NULL pointer dereference

In case of handling connect scan response, if cm_req is not found for
scan id, cm_req will be NULL and is getting deref at
cm_send_connect_start_fail.
Add fix to avoid NULL pointer dereference

Change-Id: I6b30a4bc41d3b0568dd307c91a7a7202d92b9c87
CRs-Fixed: 2877829
Himanshu Batra 4 years ago
parent
commit
02d0594adf
1 changed files with 3 additions and 3 deletions
  1. 3 3
      umac/mlme/connection_mgr/core/src/wlan_cm_connect_scan.c

+ 3 - 3
umac/mlme/connection_mgr/core/src/wlan_cm_connect_scan.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2015,2020-2021 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
  * purpose with or without fee is hereby granted, provided that the above
@@ -189,11 +189,11 @@ QDF_STATUS cm_connect_scan_resp(struct cnx_mgr *cm_ctx, wlan_scan_id *scan_id,
 	enum wlan_cm_connect_fail_reason reason = CM_GENERIC_FAILURE;
 	enum wlan_cm_connect_fail_reason reason = CM_GENERIC_FAILURE;
 
 
 	if (!*scan_id)
 	if (!*scan_id)
-		goto scan_failure;
+		return QDF_STATUS_E_FAILURE;
 
 
 	cm_req = cm_get_req_by_scan_id(cm_ctx, *scan_id);
 	cm_req = cm_get_req_by_scan_id(cm_ctx, *scan_id);
 	if (!cm_req)
 	if (!cm_req)
-		goto scan_failure;
+		return QDF_STATUS_E_FAILURE;
 
 
 	if (QDF_IS_STATUS_ERROR(status)) {
 	if (QDF_IS_STATUS_ERROR(status)) {
 		reason = CM_NO_CANDIDATE_FOUND;
 		reason = CM_NO_CANDIDATE_FOUND;