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
2 files changed