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
This commit is contained in:
Abhinav Kumar 2017-12-19 15:11:54 +05:30 • committed by nshrivas
commit 7ae9b7bed4

View file

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