mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
qcacld-3.0: Fix memory leak in sme_get_link_speed
In the API sme_get_link_speed, the driver allocates memory to the req, needed to get link speed from firmware but is not freed, thus a memory leak may happen. Fix is to remove the req from this API as the driver already has this info from caller API. Change-Id: I091bd81b162cd7e6f548068866ecdd441302553a CRs-Fixed: 2257373
This commit is contained in:
parent
11db06e305
commit
ca8f461682
1 changed files with 1 additions and 11 deletions
|
|
@ -8244,7 +8244,6 @@ QDF_STATUS sme_get_link_speed(tHalHandle hHal, tSirLinkSpeedInfo *lsReq,
|
|||
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
tpAniSirGlobal pMac;
|
||||
tSirLinkSpeedInfo *req;
|
||||
void *wma_handle;
|
||||
|
||||
if (!hHal || !pCallbackfn || !lsReq) {
|
||||
|
|
@ -8261,25 +8260,16 @@ QDF_STATUS sme_get_link_speed(tHalHandle hHal, tSirLinkSpeedInfo *lsReq,
|
|||
}
|
||||
|
||||
pMac = PMAC_STRUCT(hHal);
|
||||
req = qdf_mem_malloc(sizeof(*req));
|
||||
if (!req) {
|
||||
sme_err("Failed to allocate memory");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
*req = *lsReq;
|
||||
|
||||
status = sme_acquire_global_lock(&pMac->sme);
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
sme_err("Failed to acquire global lock");
|
||||
qdf_mem_free(req);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
pMac->sme.pLinkSpeedCbContext = plsContext;
|
||||
pMac->sme.pLinkSpeedIndCb = pCallbackfn;
|
||||
status = wma_get_link_speed(wma_handle, req);
|
||||
status = wma_get_link_speed(wma_handle, lsReq);
|
||||
sme_release_global_lock(&pMac->sme);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue