From 16e7479fa618097361c6dc65ad0ef1bac986d85f Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 26 Sep 2018 13:23:17 -0700 Subject: [PATCH] qcacmn: Fix kw issue in target_if_nan_deregister_events Potential NULL pointer dereference of handle in target_if_nan_deregister_events. Add null check in the function. Change-Id: Ie30720b525c457e6c805bd0d212044be9270bd53 CRs-Fixed: 2323349 --- target_if/nan/src/target_if_nan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target_if/nan/src/target_if_nan.c b/target_if/nan/src/target_if_nan.c index 0cf64e449e34..99d707cb01c8 100644 --- a/target_if/nan/src/target_if_nan.c +++ b/target_if/nan/src/target_if_nan.c @@ -766,6 +766,10 @@ QDF_STATUS target_if_nan_deregister_events(struct wlan_objmgr_psoc *psoc) int ret, status = 0; wmi_unified_t handle = get_wmi_unified_hdl_from_psoc(psoc); + if (!handle) { + target_if_err("handle is NULL"); + return QDF_STATUS_E_FAILURE; + } ret = wmi_unified_unregister_event_handler(handle, wmi_ndl_schedule_update_event_id); if (ret) {