aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2008-12-16 18:22:41 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-16 18:22:41 -0500
commitbb5f133dbc4f04b6388715d364ae5865455166c2 (patch)
tree9f8fdc3150b8bc48730eded83b56af84051ae2f2 /drivers
parent2c413a6434dca02387a263dc4ca8009692421998 (diff)
tlan: Fix pci memory unmapping
Fix pci unmapping problem introduced by commit id 8953f1282793882a5444924f7a273dc72a43d0a3 "tlan: Fix small (< 64 bytes) datagram transmissions". Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/tlan.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index cf8cdafda5af..e60498232b94 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -1433,7 +1433,9 @@ static u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int )
1433 if ( ! bbuf ) { 1433 if ( ! bbuf ) {
1434 struct sk_buff *skb = TLan_GetSKB(head_list); 1434 struct sk_buff *skb = TLan_GetSKB(head_list);
1435 pci_unmap_single(priv->pciDev, head_list->buffer[0].address, 1435 pci_unmap_single(priv->pciDev, head_list->buffer[0].address,
1436 skb->len, PCI_DMA_TODEVICE); 1436 max(skb->len,
1437 (unsigned int)TLAN_MIN_FRAME_SIZE),
1438 PCI_DMA_TODEVICE);
1437 dev_kfree_skb_any(skb); 1439 dev_kfree_skb_any(skb);
1438 head_list->buffer[8].address = 0; 1440 head_list->buffer[8].address = 0;
1439 head_list->buffer[9].address = 0; 1441 head_list->buffer[9].address = 0;
@@ -2057,9 +2059,12 @@ static void TLan_FreeLists( struct net_device *dev )
2057 list = priv->txList + i; 2059 list = priv->txList + i;
2058 skb = TLan_GetSKB(list); 2060 skb = TLan_GetSKB(list);
2059 if ( skb ) { 2061 if ( skb ) {
2060 pci_unmap_single(priv->pciDev, 2062 pci_unmap_single(
2061 list->buffer[0].address, skb->len, 2063 priv->pciDev,
2062 PCI_DMA_TODEVICE); 2064 list->buffer[0].address,
2065 max(skb->len,
2066 (unsigned int)TLAN_MIN_FRAME_SIZE),
2067 PCI_DMA_TODEVICE);
2063 dev_kfree_skb_any( skb ); 2068 dev_kfree_skb_any( skb );
2064 list->buffer[8].address = 0; 2069 list->buffer[8].address = 0;
2065 list->buffer[9].address = 0; 2070 list->buffer[9].address = 0;