qcacmn: Avoid re allocation of req in mlo_ser_set_link_req
In mlo_ser_set_link_req, req is again allocated and thus the req->ctx.cb_arg doesn't points to the new memory. so avod reallocating the req memory again in mlo_ser_set_link_req and use the passed memory directly as umac_cmd. Change-Id: I0bdc9cf746b2a36c69b5ca0f773f06900a9783dd CRs-Fixed: 3188736
This commit is contained in:

committed by
Madan Koyyalamudi

parent
08940324e7
commit
6606026e3f
@@ -565,7 +565,6 @@ QDF_STATUS mlo_ser_set_link_req(struct mlo_link_set_active_req *req)
|
||||
struct wlan_serialization_command cmd = {0, };
|
||||
enum wlan_serialization_status ser_cmd_status;
|
||||
QDF_STATUS status;
|
||||
void *umac_cmd;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
|
||||
if (!req)
|
||||
@@ -579,13 +578,6 @@ QDF_STATUS mlo_ser_set_link_req(struct mlo_link_set_active_req *req)
|
||||
return status;
|
||||
}
|
||||
|
||||
umac_cmd = qdf_mem_malloc(sizeof(*req));
|
||||
if (!umac_cmd) {
|
||||
status = QDF_STATUS_E_NOMEM;
|
||||
goto out;
|
||||
}
|
||||
qdf_mem_copy(umac_cmd, req, sizeof(*req));
|
||||
|
||||
cmd.cmd_type = WLAN_SER_CMD_SET_MLO_LINK;
|
||||
cmd.cmd_id = 0;
|
||||
cmd.cmd_cb = mlo_ser_set_link_cb;
|
||||
@@ -594,7 +586,7 @@ QDF_STATUS mlo_ser_set_link_req(struct mlo_link_set_active_req *req)
|
||||
cmd.cmd_timeout_duration = MLO_SER_CMD_TIMEOUT_MS;
|
||||
cmd.vdev = vdev;
|
||||
cmd.is_blocking = true;
|
||||
cmd.umac_cmd = umac_cmd;
|
||||
cmd.umac_cmd = (void *)req;
|
||||
|
||||
ser_cmd_status = wlan_serialization_request(&cmd);
|
||||
switch (ser_cmd_status) {
|
||||
@@ -610,12 +602,9 @@ QDF_STATUS mlo_ser_set_link_req(struct mlo_link_set_active_req *req)
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
out:
|
||||
if (QDF_IS_STATUS_SUCCESS(status))
|
||||
return status;
|
||||
|
||||
if (umac_cmd)
|
||||
qdf_mem_free(umac_cmd);
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLO_MGR_ID);
|
||||
|
||||
return status;
|
||||
|
Reference in New Issue
Block a user