Преглед на файлове

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);
 			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);