nuport-mac: unmap the DMA buffer when closing device
authorFlorian Fainelli <florian@openwrt.org>
Wed, 8 Aug 2012 21:51:09 +0000 (21:51 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Wed, 8 Aug 2012 21:51:09 +0000 (21:51 +0000)
SVN-Revision: 33068

target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c

index 38dbe1ee7d06b7ffd9ed8f4f62a5739f2c6fd92c..ebf95a65333b47522853c10473637e922b2c896f 100644 (file)
@@ -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)