Преглед изворни кода

qcacld-3.0: Fix mem leak in hdd_wlan_start_modules

In function hdd_wlan_start_modules, when hdd_configure_cds
return error, driver does not free memory buffer
hdd_ctx->target_hw_name in hdd_update_hw_sw_info, which is
allocated when the driver is in the open state.

Fix is to free the memory for hdd_ctx->target_hw_name buffer
and set to NULL.

Change-Id: Ib8bee8d4df51404e848cfd4da628ebf3f7ff718d
CRs-Fixed: 2159490
Abhinav Kumar пре 7 година
родитељ
комит
7ae9b7bed4
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      core/hdd/src/wlan_hdd_main.c

+ 4 - 1
core/hdd/src/wlan_hdd_main.c

@@ -2867,7 +2867,10 @@ power_down:
 release_lock:
 	hdd_ctx->start_modules_in_progress = false;
 	mutex_unlock(&hdd_ctx->iface_change_lock);
-
+	if (hdd_ctx->target_hw_name) {
+		qdf_mem_free(hdd_ctx->target_hw_name);
+		hdd_ctx->target_hw_name = NULL;
+	}
 	/* many adapter resources are not freed by design in SSR case */
 	if (!reinit)
 		hdd_check_for_leaks();