qcacld-3.0: Add zero check before division
In function pmo_core_calculate_listen_interval the max_mod_dtim is obtained by division of sta ditm with the max ditm. The max ditm can be zero and can cause divide by zero assert. Add a zero check before division. Change-Id: Ie48c8b1086efa4f36e55e83b44cc9cc528ed908d CRs-Fixed: 2475568
此提交包含在:
@@ -109,7 +109,7 @@ static QDF_STATUS pmo_core_calculate_listen_interval(
|
||||
struct pmo_vdev_priv_obj *vdev_ctx,
|
||||
uint32_t *listen_interval)
|
||||
{
|
||||
uint32_t max_mod_dtim;
|
||||
uint32_t max_mod_dtim, max_dtim;
|
||||
uint32_t beacon_interval_mod;
|
||||
struct pmo_psoc_cfg *psoc_cfg = &vdev_ctx->pmo_psoc_ctx->psoc_cfg;
|
||||
struct wlan_objmgr_psoc *psoc = wlan_vdev_get_psoc(vdev);
|
||||
@@ -134,9 +134,15 @@ static QDF_STATUS pmo_core_calculate_listen_interval(
|
||||
if (beacon_interval_mod == 0)
|
||||
beacon_interval_mod = 1;
|
||||
|
||||
max_mod_dtim = psoc_cfg->sta_max_li_mod_dtim /
|
||||
(pmo_core_get_vdev_dtim_period(vdev)
|
||||
* beacon_interval_mod);
|
||||
max_dtim = pmo_core_get_vdev_dtim_period(vdev) *
|
||||
beacon_interval_mod;
|
||||
|
||||
if (!max_dtim) {
|
||||
pmo_err("Invalid dtim period");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
max_mod_dtim = psoc_cfg->sta_max_li_mod_dtim / max_dtim;
|
||||
|
||||
if (max_mod_dtim <= 0)
|
||||
max_mod_dtim = 1;
|
||||
|
新增問題並參考
封鎖使用者