qcacmn: Move RBM value check before rx descriptor fetch

The rx descriptor may be invalid if RBM is incorrect.
Check the RBM value before fetching the rx descriptor.

Change-Id: I12cc99ceb31b8bbf0127591e1c275b13264eb80c
This commit is contained in:
syed touqeer pasha 2019-03-12 14:49:27 +05:30 • committed by nshrivas
commit 576972b9e5

View file

@ -1142,20 +1142,18 @@ dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
hal_rx_msdu_list_get(soc->hal_soc, link_desc_va, &msdu_list,
&num_msdus);
rx_desc = dp_rx_cookie_2_va_rxdma_buf(soc,
msdu_list.sw_cookie[0]);
qdf_assert_always(rx_desc);
mac_id = rx_desc->pool_id;
if (qdf_unlikely((msdu_list.rbm[0] != DP_WBM2SW_RBM) &&
(msdu_list.rbm[0] !=
HAL_RX_BUF_RBM_WBM_IDLE_DESC_LIST))) {
/* TODO */
/* Call appropriate handler */
DP_STATS_INC(soc, rx.err.invalid_rbm, 1);
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
FL("Invalid RBM %d"), msdu_list.rbm[0]);
if (!wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx)) {
DP_STATS_INC(soc, rx.err.invalid_rbm, 1);
QDF_TRACE(QDF_MODULE_ID_DP,
QDF_TRACE_LEVEL_ERROR,
FL("Invalid RBM %d"),
msdu_list.rbm[0]);
}
/* Return link descriptor through WBM ring (SW2WBM)*/
dp_rx_link_desc_return(soc, ring_desc,
@ -1163,6 +1161,12 @@ dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
continue;
}
rx_desc = dp_rx_cookie_2_va_rxdma_buf(soc,
msdu_list.sw_cookie[0]);
qdf_assert_always(rx_desc);
mac_id = rx_desc->pool_id;
/* Get the MPDU DESC info */
hal_rx_mpdu_desc_info_get(ring_desc, &mpdu_desc_info);