Browse Source

qcacld-3.0: Possible mem leak in wma_roam_scan_offload_mode

wma_roam_scan_offload_mode, allocates mem for params buffer
to store roaming offload scan parameters locally from incoming
roam req. In last it calls wmi_unified_roam_scan_offload_mode_cmd
using param as an argument to set roam scan parameters to wmi
structure and free the local param buffer in the successful case.
But in case if driver unable to write wmi struct,
wma_roam_scan_offload_mode returns error status to its caller
without freeing locally allocated params mem buffer. This results
in mem leak while unsuccessful roaming offload.

Fix is to free locally allocated mem buff before the return
in case of roaming offload failure

Change-Id: Ic73f0b3ec004c3dcc53076594c0b872a29fee633
CRs-Fixed: 2308506
Abhinav Kumar 6 years ago
parent
commit
1138a912a7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/wma/src/wma_scan_roam.c

+ 1 - 1
core/wma/src/wma_scan_roam.c

@@ -377,11 +377,11 @@ QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
 
 	status = wmi_unified_roam_scan_offload_mode_cmd(wma_handle->wmi_handle,
 				scan_cmd_fp, params);
+	qdf_mem_free(params);
 	if (QDF_IS_STATUS_ERROR(status))
 		return status;
 
 	WMA_LOGD("%s: WMA --> WMI_ROAM_SCAN_MODE", __func__);
-	qdf_mem_free(params);
 	return status;
 }