qcacmn: Add null check for legacy callback functions in policy manager
Add null check for callback functions registered from legacy modules with policy manager. Change-Id: I8a08870ea904f4e01a17f6a472bdd609df9c3c4c CRs-Fixed: 2009818
This commit is contained in:

committed by
Sandeep Puligilla

parent
564d355833
commit
ac2819788b
@@ -260,7 +260,7 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc,
|
||||
vdev_id);
|
||||
return status;
|
||||
}
|
||||
|
||||
if (pm_ctx->wma_cbacks.wma_get_connection_info) {
|
||||
status = pm_ctx->wma_cbacks.wma_get_connection_info(
|
||||
vdev_id, &conn_table_entry);
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
@@ -268,6 +268,11 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc,
|
||||
vdev_id);
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
policy_mgr_err("wma_get_connection_info is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
mode = policy_mgr_get_mode(conn_table_entry.type,
|
||||
conn_table_entry.sub_type);
|
||||
chan = reg_freq_to_chan(conn_table_entry.mhz);
|
||||
|
@@ -523,7 +523,7 @@ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc)
|
||||
policy_mgr_notice("DBS is disabled");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pm_ctx->wma_cbacks.wma_is_service_enabled) {
|
||||
policy_mgr_notice("DBS service bit map: %d",
|
||||
pm_ctx->wma_cbacks.wma_is_service_enabled(
|
||||
WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT));
|
||||
@@ -535,6 +535,8 @@ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc)
|
||||
if (!(pm_ctx->wma_cbacks.wma_is_service_enabled(
|
||||
WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)))
|
||||
return false;
|
||||
} else
|
||||
return false;
|
||||
|
||||
for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) {
|
||||
param = pm_ctx->hw_mode.hw_mode_list[i];
|
||||
@@ -562,16 +564,20 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc)
|
||||
policy_mgr_err("Invalid Context");
|
||||
return false;
|
||||
}
|
||||
if (pm_ctx->wma_cbacks.wma_is_service_enabled) {
|
||||
policy_mgr_notice("DBS service bit map: %d",
|
||||
pm_ctx->wma_cbacks.wma_is_service_enabled(
|
||||
WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT));
|
||||
|
||||
/* The agreement with FW is that: To know if the target is SBS
|
||||
* capable, SBS needs to be supported both in the HW mode list
|
||||
* and DBS needs to be supported in the service ready event
|
||||
*/
|
||||
if (!(pm_ctx->wma_cbacks.wma_is_service_enabled(
|
||||
WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) {
|
||||
policy_mgr_err("SBS cannot be supported since DBS is disabled");
|
||||
WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)))
|
||||
return false;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) {
|
||||
param = pm_ctx->hw_mode.hw_mode_list[i];
|
||||
@@ -1178,7 +1184,7 @@ QDF_STATUS policy_mgr_incr_connection_count(
|
||||
pm_ctx->user_cfg.max_concurrent_active_sessions);
|
||||
return status;
|
||||
}
|
||||
|
||||
if (pm_ctx->wma_cbacks.wma_get_connection_info) {
|
||||
status = pm_ctx->wma_cbacks.wma_get_connection_info(
|
||||
vdev_id, &conn_table_entry);
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
@@ -1186,6 +1192,11 @@ QDF_STATUS policy_mgr_incr_connection_count(
|
||||
vdev_id);
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
policy_mgr_err("wma_get_connection_info is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
mode = policy_mgr_get_mode(conn_table_entry.type,
|
||||
conn_table_entry.sub_type);
|
||||
chan = reg_freq_to_chan(conn_table_entry.mhz);
|
||||
|
Reference in New Issue
Block a user