qcacmn: Fix NULL pointer dereference issues in scan and power debug

get_pdev_wmi_handle() can return a NULL pointer in some cases.
Perform a NULL check before using the returned pointer.

target_psoc_get_service_ext_param() can return NULL pointer in
some cases. Perform a NULL check before using the pointer.

The power debug command can  take a maximum of WMI_MAX_POWER_DBG_ARGS
arguments. Check for the limit before indexing the array to avoid
illegal access of memory or overflow the array.

Change-Id: I264475e9f86c7a7e78b17b7a1fa025718a7c5af6
CRs-Fixed: 2196063
This commit is contained in:
Varun Reddy Yeturu
2018-02-27 13:46:11 -08:00
committad av Nitesh Shrivastav
förälder 2cd4bfb104
incheckning 1848acda2b
2 ändrade filer med 24 tillägg och 6 borttagningar

Visa fil

@@ -529,6 +529,10 @@ QDF_STATUS target_if_free_psoc_tgt_info(struct wlan_objmgr_psoc *psoc)
tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
ext_param = target_psoc_get_service_ext_param(tgt_psoc_info);
if (!ext_param) {
target_if_err("tgt_psoc_info is NULL");
return QDF_STATUS_E_INVAL;
}
init_deinit_chainmask_table_free(ext_param);
wlan_psoc_set_tgt_if_handle(psoc, NULL);