qcacmn: Fix invalid osif_vdev issue

Currently as part of TDLS connection if TLDS connection is formed
on secondary vdev, osif_vdev of secondary vdev is updated with
osif_vdev of primary vdev.
Due to osif_vdev update, during vdev delete 1st vdev will call
API to free osif_vdev. When 2nd vdev try to access the osif_vdev
it will result in invalid pointer access.

As current change was done to handle case where osif_vdev
for MLO connection used to point to 2 different interfaces
and where secondary interface used to point to NULL/dummy netdev.
As per latest change osif_vdev will point to per vdev dp_link
which for MLO connection will have single interface. So osif_vdev
update is not required anymore.

So, to fix invalid/stale pointer issue remove osif_vdev update for
TDLS connection.

CRs-Fixed: 3814466
Change-Id: Icac13d88411ca572c9d5823a6bd2d3d5b1ba632f
This commit is contained in:
Amit Mehta
2024-05-21 03:19:16 -07:00
committed by Ravindra Konda
parent 00e159df45
commit 4d9cda5abb

View File

@@ -8896,9 +8896,8 @@ dp_set_vdev_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id,
* @param: parameter type for vdev
* @val: value
*
* If TDLS connection is from secondary vdev, then copy osif_vdev from
* primary vdev to support RX, update TX bank register info for primary
* vdev as well.
* If TDLS connection is from secondary vdev, then update TX bank register
* info for primary vdev as well.
* If TDLS connection is from primary vdev, same as before.
*
* Return: None
@@ -8953,11 +8952,9 @@ dp_update_mlo_vdev_for_tdls(struct cdp_soc_t *cdp_soc, uint8_t vdev_id,
/* If current vdev is not same as primary vdev */
if (pri_vdev && pri_vdev != vdev) {
dp_info("primary vdev [%d] %pK different with vdev [%d] %pK",
dp_info("primary vdev [%d] %pK different from vdev [%d] %pK",
pri_vdev->vdev_id, pri_vdev,
vdev->vdev_id, vdev);
/* update osif_vdev to support RX for vdev */
vdev->osif_vdev = pri_vdev->osif_vdev;
dp_set_vdev_param(cdp_soc, pri_vdev->vdev_id,
CDP_UPDATE_TDLS_FLAGS, val);
}