Browse Source

qcacld-3.0: Check NULL value of wmi_handle

In target_if_register_mgmt_data_offload_event(), check NULL value of
wmi_handle before it's used by wmi_service_enabled()

Change-Id: Iea51c59770258fd10468bb439f559094b563851f
CRs-Fixed: 2900533
Jyoti Kumari 4 years ago
parent
commit
6308349a61
1 changed files with 6 additions and 1 deletions
  1. 6 1
      components/target_if/pkt_capture/src/target_if_pkt_capture.c

+ 6 - 1
components/target_if/pkt_capture/src/target_if_pkt_capture.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -175,6 +175,11 @@ target_if_register_mgmt_data_offload_event(struct wlan_objmgr_psoc *psoc)
 	}
 	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
 
+	if (!wmi_handle) {
+		pkt_capture_err("wmi_handle is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	if ((ucfg_pkt_capture_get_mode(psoc) != PACKET_CAPTURE_MODE_DISABLE) &&
 	    wmi_service_enabled(wmi_handle,
 				wmi_service_packet_capture_support)) {