浏览代码

qcacld-3.0: Fix memory leak in wmi stats req without rsp

While sending WMI_REQUEST_STATS_CMDID, wma stores the request in a
allocated buffer, which is freed once firmware response is received.
However in case of driver unload, before we receive firmware event,
the buffer will not be freed and that will be leaked. Fix the memory
leak by checking for these buffers at time of wma_wmi_service_close.

Change-Id: Ie8fd5faec22ceaba415a26becf98030bc7cc13ce
CRs-Fixed: 1116622
yeshwanth sriram guntuka 8 年之前
父节点
当前提交
8dd8038f9a
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      core/wma/src/wma_main.c

+ 5 - 0
core/wma/src/wma_main.c

@@ -3325,6 +3325,11 @@ QDF_STATUS wma_wmi_service_close(void *cds_ctx)
 			qdf_mem_free(wma_handle->interfaces[i].del_staself_req);
 			qdf_mem_free(wma_handle->interfaces[i].del_staself_req);
 			wma_handle->interfaces[i].del_staself_req = NULL;
 			wma_handle->interfaces[i].del_staself_req = NULL;
 		}
 		}
+
+		if (wma_handle->interfaces[i].stats_rsp) {
+			qdf_mem_free(wma_handle->interfaces[i].stats_rsp);
+			wma_handle->interfaces[i].stats_rsp = NULL;
+		}
 	}
 	}
 
 
 	qdf_mem_free(wma_handle->interfaces);
 	qdf_mem_free(wma_handle->interfaces);