From 043efbd6ae3d1e95c8d058434645866f46f53058 Mon Sep 17 00:00:00 2001 From: Mohit Khanna Date: Wed, 4 May 2016 14:19:35 -0700 Subject: [PATCH] qcacld-3.0: Fix race condition between tx traffic and peer deletion A race condition has been observed between outgoing TX traffic and peer deletion when DUT has concurrent SAP(DBS) and STA sessions in 5G and 2G respectively and the peer connected to SAP moves away triggering peer deletion at DUT. Due to peer being deleted, the vdev corresponding to the peer is void which results in a crash in ol_tx_data function while trying to send Tx data. Fix crash by checking for a null vdev in ol_tx_data. CRs-Fixed: 1012681 Change-Id: Id0aab4b1f03ed24dfb55e09fa1a115edfdfcce84 --- core/dp/txrx/ol_tx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/dp/txrx/ol_tx.c b/core/dp/txrx/ol_tx.c index b258790f570b..5a9db2d89aa3 100644 --- a/core/dp/txrx/ol_tx.c +++ b/core/dp/txrx/ol_tx.c @@ -142,10 +142,18 @@ static inline uint8_t ol_tx_prepare_tso(ol_txrx_vdev_handle vdev, qdf_nbuf_t ol_tx_data(ol_txrx_vdev_handle vdev, qdf_nbuf_t skb) { void *qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); - struct ol_txrx_pdev_t *pdev = vdev->pdev; + struct ol_txrx_pdev_t *pdev; qdf_nbuf_t ret; QDF_STATUS status; + if (qdf_unlikely(!vdev)) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_WARN, + "%s:vdev is null", __func__); + return skb; + } else { + pdev = vdev->pdev; + } + if (qdf_unlikely(!pdev)) { QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_WARN, "%s:pdev is null", __func__);