From d6a0e8d33c0ad05caabb043328344fe0f6bb621d Mon Sep 17 00:00:00 2001 From: Jyoti Kumari Date: Tue, 16 Mar 2021 15:54:14 +0530 Subject: [PATCH] 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 --- .../target_if/pkt_capture/src/target_if_pkt_capture.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/target_if/pkt_capture/src/target_if_pkt_capture.c b/components/target_if/pkt_capture/src/target_if_pkt_capture.c index 7621667e304d..7c31b5228f76 100644 --- a/components/target_if/pkt_capture/src/target_if_pkt_capture.c +++ b/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)) {