qcacmn: Fix KW issues

Potential NULL pointer dereferences of wmi_handle are found in these
functions:
wmi_extract_dfs_cac_complete_event()
wmi_extract_dfs_radar_detection_event()
wmi_extract_reg_chan_list_update_event()
wmi_extract_reg_11d_new_cc_event()
wmi_extract_reg_ch_avoid_event()

Introduce wmi_handle NULL check in the above functions.

Change-Id: I30a842818dff400b8648293f65794ff382eb24e7
CRs-Fixed: 2286258
This commit is contained in:
Vignesh U
2018-07-26 14:08:29 +05:30
committed by nshrivas
parent b9e1e5456a
commit e2a50e4067
2 changed files with 5 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl,
{ {
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->extract_dfs_cac_complete_event) if (wmi_handle && wmi_handle->ops->extract_dfs_cac_complete_event)
return wmi_handle->ops->extract_dfs_cac_complete_event( return wmi_handle->ops->extract_dfs_cac_complete_event(
wmi_handle, evt_buf, vdev_id, len); wmi_handle, evt_buf, vdev_id, len);
@@ -50,7 +50,7 @@ QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl,
{ {
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->extract_dfs_radar_detection_event) if (wmi_handle && wmi_handle->ops->extract_dfs_radar_detection_event)
return wmi_handle->ops->extract_dfs_radar_detection_event( return wmi_handle->ops->extract_dfs_radar_detection_event(
wmi_handle, evt_buf, radar_found, len); wmi_handle, evt_buf, radar_found, len);

View File

@@ -35,7 +35,7 @@ QDF_STATUS wmi_extract_reg_chan_list_update_event(void *wmi_hdl,
{ {
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->extract_reg_chan_list_update_event) if (wmi_handle && wmi_handle->ops->extract_reg_chan_list_update_event)
return wmi_handle->ops->extract_reg_chan_list_update_event return wmi_handle->ops->extract_reg_chan_list_update_event
(wmi_handle, (wmi_handle,
evt_buf, reg_info, len); evt_buf, reg_info, len);
@@ -87,7 +87,7 @@ QDF_STATUS wmi_extract_reg_11d_new_cc_event(void *wmi_hdl,
{ {
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->extract_reg_11d_new_country_event) if (wmi_handle && wmi_handle->ops->extract_reg_11d_new_country_event)
return wmi_handle->ops->extract_reg_11d_new_country_event( return wmi_handle->ops->extract_reg_11d_new_country_event(
wmi_handle, evt_buf, reg_11d_new_cc, len); wmi_handle, evt_buf, reg_11d_new_cc, len);
@@ -115,7 +115,7 @@ QDF_STATUS wmi_extract_reg_ch_avoid_event(void *wmi_hdl,
{ {
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->extract_reg_ch_avoid_event) if (wmi_handle && wmi_handle->ops->extract_reg_ch_avoid_event)
return wmi_handle->ops->extract_reg_ch_avoid_event( return wmi_handle->ops->extract_reg_ch_avoid_event(
wmi_handle, evt_buf, ch_avoid_ind, len); wmi_handle, evt_buf, ch_avoid_ind, len);