Browse Source

qcacld-3.0: Avoid NULL pointer dereference

In function hdd_is_connection_in_progress the arguments
out_vdev_id and out_reason can be NULL. For device mode
is SAP or P2P_GO possible NULL dereference can happen.

Add NULL check for out_vdev_id and out_reason before
dereference.

Change-Id: I9c5c88f41f510483a01fe7b355538942360bd641
CRs-Fixed: 2531567
Bala Venkatesh 5 years ago
parent
commit
25b852b999
1 changed files with 5 additions and 2 deletions
  1. 5 2
      core/hdd/src/wlan_hdd_main.c

+ 5 - 2
core/hdd/src/wlan_hdd_main.c

@@ -15360,8 +15360,11 @@ bool hdd_is_connection_in_progress(uint8_t *out_vdev_id,
 			}
 			if (hdd_ctx->connection_in_progress) {
 				hdd_debug("AP/GO: connection is in progress");
-				*out_reason = SAP_CONNECTION_IN_PROGRESS;
-				*out_vdev_id = adapter->vdev_id;
+				if (out_vdev_id && out_reason) {
+					*out_reason =
+						SAP_CONNECTION_IN_PROGRESS;
+					*out_vdev_id = adapter->vdev_id;
+				}
 				return true;
 			}
 		}