qcacmn: Fix possible NULL pointer dereference

In son_ol_send_null(), check for the return value of
GET_WMI_HDL_FROM_PSOC() before using it.

Also, pass argument of type wmi_unified_t in calls
to wmi_unified_stats_request_send().

Change-Id: Idfedae2fcbde6d18b1829adefcabac0adbc55859
CRs-Fixed: 2371368
This commit is contained in:
Anirban Sirkhell
2018-12-21 12:06:49 +05:30
committed by nshrivas
parent 604e249bc1
commit 0f2677d572
3 changed files with 13 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -49,17 +49,20 @@ QDF_STATUS son_ol_send_null(struct wlan_objmgr_pdev *pdev,
{
struct stats_request_params param = {0};
struct wlan_objmgr_psoc *psoc = NULL;
wmi_unified_t wmi_handle;
psoc = wlan_pdev_get_psoc(pdev);
if (!psoc)
return QDF_STATUS_E_FAILURE;
param.vdev_id = wlan_vdev_get_id(vdev);
param.stats_id = WMI_HOST_REQUEST_INST_STAT;
return wmi_unified_stats_request_send(GET_WMI_HDL_FROM_PSOC(psoc),
macaddr, &param);
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
if (!wmi_handle)
return QDF_STATUS_E_FAILURE;
return wmi_unified_stats_request_send(wmi_handle, macaddr, &param);
}
int son_ol_lmac_create(struct wlan_objmgr_pdev *pdev)