|
@@ -395,6 +395,12 @@ int cnss_wlfw_respond_mem_send_sync(struct cnss_plat_data *plat_priv)
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
|
|
|
+ if (plat_priv->fw_mem_seg_len > QMI_WLFW_MAX_NUM_MEM_SEG_V01) {
|
|
|
+ cnss_pr_err("Invalid seg len %u\n", plat_priv->fw_mem_seg_len);
|
|
|
+ ret = -EINVAL;
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
req->mem_seg_len = plat_priv->fw_mem_seg_len;
|
|
|
for (i = 0; i < req->mem_seg_len; i++) {
|
|
|
if (!fw_mem[i].pa || !fw_mem[i].size) {
|
|
@@ -2112,6 +2118,12 @@ int cnss_wlfw_qdss_trace_mem_info_send_sync(struct cnss_plat_data *plat_priv)
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
|
|
|
+ if (plat_priv->qdss_mem_seg_len > QMI_WLFW_MAX_NUM_MEM_SEG_V01) {
|
|
|
+ cnss_pr_err("Invalid seg len %u\n", plat_priv->qdss_mem_seg_len);
|
|
|
+ ret = -EINVAL;
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
req->mem_seg_len = plat_priv->qdss_mem_seg_len;
|
|
|
for (i = 0; i < req->mem_seg_len; i++) {
|
|
|
cnss_pr_dbg("Memory for FW, va: 0x%pK, pa: %pa, size: 0x%zx, type: %u\n",
|
|
@@ -2480,6 +2492,11 @@ static void cnss_wlfw_request_mem_ind_cb(struct qmi_handle *qmi_wlfw,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (ind_msg->mem_seg_len > QMI_WLFW_MAX_NUM_MEM_SEG_V01) {
|
|
|
+ cnss_pr_err("Invalid seg len %u\n", ind_msg->mem_seg_len);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
plat_priv->fw_mem_seg_len = ind_msg->mem_seg_len;
|
|
|
for (i = 0; i < plat_priv->fw_mem_seg_len; i++) {
|
|
|
cnss_pr_dbg("FW requests for memory, size: 0x%x, type: %u\n",
|
|
@@ -2694,6 +2711,11 @@ static void cnss_wlfw_qdss_trace_req_mem_ind_cb(struct qmi_handle *qmi_wlfw,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (ind_msg->mem_seg_len > QMI_WLFW_MAX_NUM_MEM_SEG_V01) {
|
|
|
+ cnss_pr_err("Invalid seg len %u\n", ind_msg->mem_seg_len);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
plat_priv->qdss_mem_seg_len = ind_msg->mem_seg_len;
|
|
|
for (i = 0; i < plat_priv->qdss_mem_seg_len; i++) {
|
|
|
cnss_pr_dbg("QDSS requests for memory, size: 0x%x, type: %u\n",
|