aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcnet32.c
diff options
context:
space:
mode:
authorDon Fry <brazilnut@us.ibm.com>2005-04-29 17:51:17 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-05-15 18:22:29 -0400
commit1bcd315362e215a72b56d1330bbf32f1c74eefb5 (patch)
treeceffa79b4dee4b9a489015afaad9574fed7b9742 /drivers/net/pcnet32.c
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
[PATCH] pcnet32: fix resource leak with loopback test
When running the loopback test, resources are not properly released on completion. This patch frees all transmit resources after running the loopback test. Tested on ia32 and ppc64 hardware. Signed-off-by: Don Fry <brazilnut@us.ibm.com>
Diffstat (limited to 'drivers/net/pcnet32.c')
-rw-r--r--drivers/net/pcnet32.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 17947e6c8793..13f114876965 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -22,8 +22,8 @@
22 *************************************************************************/ 22 *************************************************************************/
23 23
24#define DRV_NAME "pcnet32" 24#define DRV_NAME "pcnet32"
25#define DRV_VERSION "1.30i" 25#define DRV_VERSION "1.30j"
26#define DRV_RELDATE "06.28.2004" 26#define DRV_RELDATE "29.04.2005"
27#define PFX DRV_NAME ": " 27#define PFX DRV_NAME ": "
28 28
29static const char *version = 29static const char *version =
@@ -256,6 +256,7 @@ static int homepna[MAX_UNITS];
256 * homepna for selecting HomePNA mode for PCNet/Home 79C978. 256 * homepna for selecting HomePNA mode for PCNet/Home 79C978.
257 * v1.30h 24 Jun 2004 Don Fry correctly select auto, speed, duplex in bcr32. 257 * v1.30h 24 Jun 2004 Don Fry correctly select auto, speed, duplex in bcr32.
258 * v1.30i 28 Jun 2004 Don Fry change to use module_param. 258 * v1.30i 28 Jun 2004 Don Fry change to use module_param.
259 * v1.30j 29 Apr 2005 Don Fry fix skb/map leak with loopback test.
259 */ 260 */
260 261
261 262
@@ -395,6 +396,7 @@ static void pcnet32_led_blink_callback(struct net_device *dev);
395static int pcnet32_get_regs_len(struct net_device *dev); 396static int pcnet32_get_regs_len(struct net_device *dev);
396static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs, 397static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
397 void *ptr); 398 void *ptr);
399static void pcnet32_purge_tx_ring(struct net_device *dev);
398 400
399enum pci_flags_bit { 401enum pci_flags_bit {
400 PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, 402 PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
@@ -785,6 +787,7 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1)
785 } 787 }
786 788
787clean_up: 789clean_up:
790 pcnet32_purge_tx_ring(dev);
788 x = a->read_csr(ioaddr, 15) & 0xFFFF; 791 x = a->read_csr(ioaddr, 15) & 0xFFFF;
789 a->write_csr(ioaddr, 15, (x & ~0x0044)); /* reset bits 6 and 2 */ 792 a->write_csr(ioaddr, 15, (x & ~0x0044)); /* reset bits 6 and 2 */
790 793