Skip to contentSkip to conversation

pcnet32: fix resource leak with loopback test

PATCH Applied Don Fry 2 participants 2 messages Apr 29, 2005 – Aug 19, 2005

Subsystems (2)
lore
Share & tools
lore

Don Fry

author
#0 lore raw

PATCH 1/1 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.

drivers/net/pcnet32.c renamed from drivers/net/orig.pcnet32.c +5 -2
@@ -22,8 +22,8 @@
  *************************************************************************/
 
 #define DRV_NAME	"pcnet32"
-#define DRV_VERSION	"1.30h"
-#define DRV_RELDATE	"06.24.2004"
+#define DRV_VERSION	"1.30j"
+#define DRV_RELDATE	"29.04.2005"
 #define PFX		DRV_NAME ": "
 
 static const char *version =
@@ -254,6 +254,7 @@ static int homepna[MAX_UNITS];
  * v1.30g  22 Jun 2004 Patrick Simmons <[email protected]> added option
  *	   homepna for selecting HomePNA mode for PCNet/Home 79C978.
  * v1.30h  24 Jun 2004 Don Fry correctly select auto, speed, duplex in bcr32.
+ * v1.30j  29 Apr 2005 Don Fry fix skb/map leak with loopback test.
  */
 
 
@@ -393,6 +394,7 @@ static void pcnet32_led_blink_callback(s
 static int pcnet32_get_regs_len(struct net_device *dev);
 static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
 	void *ptr);
+static void pcnet32_purge_tx_ring(struct net_device *dev);
 
 enum pci_flags_bit {
     PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
@@ -783,6 +785,7 @@ static int pcnet32_loopback_test(struct 
     }
 
 clean_up:
+    pcnet32_purge_tx_ring(dev);
     x = a->read_csr(ioaddr, 15) & 0xFFFF;
     a->write_csr(ioaddr, 15, (x & ~0x0044));	/* reset bits 6 and 2 */
 
Signature · 2 lines
Don Fry
[email protected]