From 2da63e421a6f84f5f67e4ce28fa34ec62dedb838 Mon Sep 17 00:00:00 2001 From: Tiger Yu Date: Tue, 6 Feb 2018 14:45:57 +0800 Subject: [PATCH] qcacld-3.0: only unmap the mapped nbuf in the ol_txrx_vdev_flush The TX buffers in the vdev->ll_pause pending queue, which haven't mapped the physical address. Adding nbuf physical address checking to avoid the mis-matching unmap especially when the MEMORY_DEBUG is enabled. Change-Id: I6b0fcd1c7d07ca358d07b9931dea321ee8c6169a CRs-Fixed: 2183678 --- core/dp/txrx/ol_tx_queue.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/dp/txrx/ol_tx_queue.c b/core/dp/txrx/ol_tx_queue.c index a9a02594172a..e7bef8ad9b19 100644 --- a/core/dp/txrx/ol_tx_queue.c +++ b/core/dp/txrx/ol_tx_queue.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1794,9 +1794,11 @@ void ol_txrx_vdev_flush(struct cdp_vdev *pvdev) qdf_nbuf_t next = qdf_nbuf_next(vdev->ll_pause.txq.head); qdf_nbuf_set_next(vdev->ll_pause.txq.head, NULL); - qdf_nbuf_unmap(vdev->pdev->osdev, - vdev->ll_pause.txq.head, - QDF_DMA_TO_DEVICE); + if (QDF_NBUF_CB_PADDR(vdev->ll_pause.txq.head)) { + qdf_nbuf_unmap(vdev->pdev->osdev, + vdev->ll_pause.txq.head, + QDF_DMA_TO_DEVICE); + } qdf_nbuf_tx_free(vdev->ll_pause.txq.head, QDF_NBUF_PKT_ERROR); vdev->ll_pause.txq.head = next;