qcacmn: Check for valid peer_id in exception path

Sometime DP might receive a exception packet with
already deleted peer id. Added a check to avoid sending
such packets.

Change-Id: Ib43d55c7930e4ddc7550d486505a56cb48e85afe
CRs-Fixed: 3285034
This commit is contained in:
Sai Rupesh Chevuru
2022-09-12 21:07:25 +05:30
committed by Madan Koyyalamudi
parent 5e42bbc352
commit c16d4c0cd9
3 changed files with 23 additions and 2 deletions

View File

@@ -3134,6 +3134,21 @@ dp_tx_send_exception(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
goto fail;
}
/* for peer based metadata check if peer is valid */
if (tx_exc_metadata->peer_id != CDP_INVALID_PEER) {
struct dp_peer *peer = NULL;
peer = dp_peer_get_ref_by_id(vdev->pdev->soc,
tx_exc_metadata->peer_id,
DP_MOD_ID_TX_EXCEPTION);
if (qdf_unlikely(!peer)) {
DP_STATS_INC(vdev,
tx_i.dropped.invalid_peer_id_in_exc_path,
1);
goto fail;
}
dp_peer_unref_delete(peer, DP_MOD_ID_TX_EXCEPTION);
}
/* Basic sanity checks for unsupported packets */
/* MESH mode */