qcacmn: Fix reachable Assert in convert_target_pdev_id_to_host_pdev_id

Currently, If invalid pdev_id is passed to
convert_target_pdev_id_to_host_pdev_id it results into Assert.

Fix is to remove QDF_ASSERT(0) in convert_target_pdev_id_to_host_pdev_id.
Return WMI_HOST_PDEV_ID_INVALID if convert_target_pdev_id_to_host_pdev_id
receives invalid pdev id.

Change-Id: Icb6a75c3f3664596fbba4532f5b29ed626ba28f2
CRs-Fixed: 2428787
This commit is contained in:
sheenam monga 2019-04-09 15:37:33 +05:30 • committed by nshrivas
commit 57effefdba
2 changed files with 14 additions and 4 deletions

View file

@ -7363,6 +7363,7 @@ struct coex_config_params {
#define WMI_HOST_PDEV_ID_0 0
#define WMI_HOST_PDEV_ID_1 1
#define WMI_HOST_PDEV_ID_2 2
#define WMI_HOST_PDEV_ID_INVALID 0xFFFFFFFF
#ifndef CMN_VDEV_MGR_TGT_IF_ENABLE
/**

View file

@ -109,9 +109,9 @@ static uint32_t convert_target_pdev_id_to_host_pdev_id(uint32_t pdev_id)
return WMI_HOST_PDEV_ID_2;
}
QDF_ASSERT(0);
WMI_LOGE("Invalid pdev_id");
return WMI_HOST_PDEV_ID_SOC;
return WMI_HOST_PDEV_ID_INVALID;
}
/**
@ -10052,8 +10052,13 @@ static QDF_STATUS extract_dfs_radar_detection_event_tlv(
}
radar_event = param_tlv->fixed_param;
radar_found->pdev_id = convert_target_pdev_id_to_host_pdev_id(
radar_event->pdev_id);
radar_event->pdev_id);
if (radar_found->pdev_id == WMI_HOST_PDEV_ID_INVALID)
return QDF_STATUS_E_FAILURE;
radar_found->detection_mode = radar_event->detection_mode;
radar_found->chan_freq = radar_event->chan_freq;
radar_found->chan_width = radar_event->chan_width;
@ -11009,8 +11014,12 @@ extract_esp_estimation_ev_param_tlv(wmi_unified_t wmi_handle,
}
esp_event = param_buf->fixed_param;
param->ac_airtime_percentage = esp_event->ac_airtime_percentage;
param->pdev_id = convert_target_pdev_id_to_host_pdev_id(
esp_event->pdev_id);
esp_event->pdev_id);
if (param->pdev_id == WMI_HOST_PDEV_ID_INVALID)
return QDF_STATUS_E_FAILURE;
return QDF_STATUS_SUCCESS;
}