qcacld-3.0: Free the tdls memory in the error conditions
As part of the tdls vdev creation, tdls osif memory is allocated and not freed in the error condition, which can result in the memory leak. Free the tdls osif memory in the error condition Change-Id: I084b14c4277be3e88142e3eaaabcf3293a15f220 CRs-Fixed: 2507609
This commit is contained in:

committato da
nshrivas

parent
c3fb27d117
commit
e8a01b80db
@@ -273,7 +273,8 @@ QDF_STATUS tdls_vdev_obj_create_notification(struct wlan_objmgr_vdev *vdev,
|
||||
tdls_vdev_obj = qdf_mem_malloc(sizeof(*tdls_vdev_obj));
|
||||
if (!tdls_vdev_obj) {
|
||||
tdls_err("Failed to allocate memory for tdls vdev object");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
status = QDF_STATUS_E_NOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
status = wlan_objmgr_vdev_component_obj_attach(vdev,
|
||||
@@ -304,7 +305,12 @@ QDF_STATUS tdls_vdev_obj_create_notification(struct wlan_objmgr_vdev *vdev,
|
||||
tdls_debug("tdls object attach to vdev successfully");
|
||||
return status;
|
||||
err:
|
||||
qdf_mem_free(tdls_vdev_obj);
|
||||
if (tdls_soc_obj->tdls_osif_deinit_cb)
|
||||
tdls_soc_obj->tdls_osif_deinit_cb(vdev);
|
||||
if (tdls_vdev_obj) {
|
||||
qdf_mem_free(tdls_vdev_obj);
|
||||
tdls_vdev_obj = NULL;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Fai riferimento in un nuovo problema
Block a user