cnss2: Update bus bandwidth device tree config read

Fix out of bounds write during device tree bus bandwidth array copy.

Change-Id: I5fa1be5beabdccc4d662c74018d8fa22c547697b
Signed-off-by: Manikandan Mohan <manikand@codeaurora.org>
This commit is contained in:
Manikandan Mohan 2020-09-11 14:53:56 -07:00
commit 7e1ba3ba5e

View file

@ -2263,7 +2263,7 @@ static int cnss_register_bus_scale(struct cnss_plat_data *plat_priv)
}
cfg_arr_size = plat_priv->icc.path_count *
plat_priv->icc.bus_bw_cfg_count * CNSS_ICC_VOTE_MAX;
cfg_arr = kzalloc(cfg_arr_size, GFP_KERNEL);
cfg_arr = kcalloc(cfg_arr_size, sizeof(*cfg_arr), GFP_KERNEL);
if (!cfg_arr) {
cnss_pr_err("Failed to alloc cfg table mem\n");
ret = -ENOMEM;