qcacld-3.0: cdp: Converge stats API

Currently cdp_host_get_vdev_stats API provided
with vdev handle as its arguments, which is
directly accessed in that API. This can cause
a race-condition in access of the respective
handle if it has been deleted in parallel.
Hence as a part of cdp convergence, pass only
the vdev_id which will be used to get the
respective handles and hence avoiding unwanted
access of the handle if it has been deleted.

Change-Id: I4cc959b9244f5c22dea71194c86c583cd9c2a071
CRs-Fixed: 2583358
This commit is contained in:
Vevek Venkatesan 2019-12-10 14:06:08 +05:30 committed by nshrivas
parent 5420578b6e
commit 31a38dc0df

View File

@ -2772,17 +2772,12 @@ void cds_incr_arp_stats_tx_tgt_acked(void)
static bool
cds_get_cdp_vdev_stats(uint8_t vdev_id, struct cdp_vdev_stats *vdev_stats)
{
void *soc;
struct cdp_pdev *pdev;
struct cdp_vdev *vdev;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
if (!vdev_stats)
return false;
if (cds_get_datapath_handles(&soc, &pdev, &vdev, vdev_id))
return false;
if (cdp_host_get_vdev_stats(soc, vdev, vdev_stats, true))
if (cdp_host_get_vdev_stats(soc, vdev_id, vdev_stats, true))
return false;
return true;