From de9bd0182ebd40529897359f99e3396f47a1e9f8 Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Fri, 21 Sep 2018 15:46:20 +0800 Subject: [PATCH] qcacmn: Fix kw issue in target_if_nan_register_events Potential NULL pointer dereference of handle in target_if_nan_register_events. Add null check in the function. Change-Id: I1fc57d712713bc47345b178c972cc5fc926a42d0 CRs-Fixed: 2317017 --- 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 4d5ca4104215..0cf64e449e34 100644 --- a/target_if/nan/src/target_if_nan.c +++ b/target_if/nan/src/target_if_nan.c @@ -685,6 +685,10 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc) int ret; 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_register_event_handler(handle, wmi_ndp_initiator_rsp_event_id, target_if_ndp_initiator_rsp_handler,