qcacmn: Add NULL check for WMI handle

Adding NULL checks for WMI handle while registering or unregistering
events or event handlers

Change-Id: Icdf7032bad7289e62f5d7b17aab9780bcdf0ab1d
This commit is contained in:
Akshay Kosigi
2018-12-15 12:07:43 +05:30
committed by nshrivas
parent eb0e456d68
commit 46050aa104

View File

@@ -1798,7 +1798,14 @@ int wmi_unified_register_event(wmi_unified_t wmi_handle,
{
uint32_t idx = 0;
uint32_t evt_id;
struct wmi_soc *soc = wmi_handle->soc;
struct wmi_soc *soc;
if (!wmi_handle) {
WMI_LOGE("WMI handle is NULL");
return QDF_STATUS_E_FAILURE;
}
soc = wmi_handle->soc;
if (event_id >= wmi_events_max ||
wmi_handle->wmi_events[event_id] == WMI_EVENT_ID_INVALID) {
@@ -1848,7 +1855,14 @@ int wmi_unified_register_event_handler(wmi_unified_t wmi_handle,
{
uint32_t idx = 0;
uint32_t evt_id;
struct wmi_soc *soc = wmi_handle->soc;
struct wmi_soc *soc;
if (!wmi_handle) {
WMI_LOGE("WMI handle is NULL");
return QDF_STATUS_E_FAILURE;
}
soc = wmi_handle->soc;
if (event_id >= wmi_events_max ||
wmi_handle->wmi_events[event_id] == WMI_EVENT_ID_INVALID) {
@@ -1935,7 +1949,14 @@ int wmi_unified_unregister_event_handler(wmi_unified_t wmi_handle,
{
uint32_t idx = 0;
uint32_t evt_id;
struct wmi_soc *soc = wmi_handle->soc;
struct wmi_soc *soc;
if (!wmi_handle) {
WMI_LOGE("WMI handle is NULL");
return QDF_STATUS_E_FAILURE;
}
soc = wmi_handle->soc;
if (event_id >= wmi_events_max ||
wmi_handle->wmi_events[event_id] == WMI_EVENT_ID_INVALID) {