From: Florian Fainelli Date: Wed, 8 Aug 2012 21:51:09 +0000 (+0000) Subject: [mcs814x] nuport-mac: unmap the DMA buffer when closing device X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=79b9a08cdbbebff02eba9c23f9808ba5db638e5a [mcs814x] nuport-mac: unmap the DMA buffer when closing device SVN-Revision: 33068 --- diff --git a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c index 38dbe1ee7d..ebf95a6533 100644 --- a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c +++ b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c @@ -688,6 +688,10 @@ static void nuport_mac_free_rx_ring(struct nuport_mac_priv *priv) dev_kfree_skb(priv->rx_skb[i]); priv->rx_skb[i] = NULL; } + + if (priv->rx_addr) + dma_unmap_single(&priv->pdev->dev, priv->rx_addr, RX_ALLOC_SIZE, + DMA_TO_DEVICE); } static void nuport_mac_read_mac_address(struct net_device *dev)