qcacmn: Initialized pdev id with default value 0xFF

pdev_id is being initialized with 0. Since 0 is valid pdev_id, though
pdev is not present for that id, it is being accessed.

Initialized pdev_id to 0xFF by default. Added checks on API to
detect valid pdev_id value corresponding to lmac_id

Change-Id: I2b2a38783615494ccc08e265702815f7e562214b
This commit is contained in:
Pavankumar Nandeshwar
2020-02-26 18:24:52 +05:30
committed by nshrivas
parent 2eb8560c88
commit 9b0c1271ed
10 changed files with 102 additions and 14 deletions

View File

@@ -1474,6 +1474,11 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
bool nbuf_used;
uint32_t rx_enh_capture_mode;
if (!pdev) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
"pdev is null for mac_id = %d", mac_id);
return;
}
ppdu_info = &pdev->ppdu_info;
rx_mon_stats = &pdev->rx_mon_stats;
@@ -1621,6 +1626,12 @@ dp_rx_mon_status_srng_process(struct dp_soc *soc, uint32_t mac_id,
QDF_STATUS status;
uint32_t work_done = 0;
if (!pdev) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
"pdev is null for mac_id = %d", mac_id);
return work_done;
}
mon_status_srng = soc->rxdma_mon_status_ring[mac_id].hal_srng;
qdf_assert(mon_status_srng);
@@ -1875,6 +1886,12 @@ QDF_STATUS dp_rx_mon_status_buffers_replenish(struct dp_soc *dp_soc,
void *rxdma_srng;
struct dp_pdev *dp_pdev = dp_get_pdev_for_lmac_id(dp_soc, mac_id);
if (!dp_pdev) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
"pdev is null for mac_id = %d", mac_id);
return QDF_STATUS_E_FAILURE;
}
rxdma_srng = dp_rxdma_srng->hal_srng;
qdf_assert(rxdma_srng);