[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170419174440.37372.23964.stgit@ltcalpine2-lp23.aus.stglabs.ibm.com>
Date: Wed, 19 Apr 2017 13:44:41 -0400
From: Nathan Fontenot <nfont@...ux.vnet.ibm.com>
To: netdev@...r.kernel.org
Cc: brking@...ux.vnet.ibm.com, jallen@...ux.vnet.ibm.com,
muvic@...ux.vnet.ibm.com, tlfalcon@...ux.vnet.ibm.com
Subject: [PATCH net-next 03/10] ibmvnic: Unmap longer term buffer before free
From: Brian King <brking@...ux.vnet.ibm.com>
Make sure we unregister long term buffers from the adapter
prior to DMA unmapping it and freeing the buffer. Failure
to do so could result in a DMA to a now invalid address.
Signed-off-by: Brian King <brking@...ux.vnet.ibm.com>
Signed-off-by: Nathan Fontenot <nfont@...ux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 625896d..c10bae7 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -193,9 +193,9 @@ static void free_long_term_buff(struct ibmvnic_adapter *adapter,
if (!ltb->buff)
return;
- dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr);
if (!adapter->failover)
send_request_unmap(adapter, ltb->map_id);
+ dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr);
}
static void replenish_rx_pool(struct ibmvnic_adapter *adapter,
Powered by blists - more mailing lists