netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Don Fry <brazilnut@us.ibm.com>
To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com
Subject: [PATCH 2.4.30] pcnet32: fix resource leak with loopback test
Date: Fri, 29 Apr 2005 14:49:56 -0700	[thread overview]
Message-ID: <20050429214956.GA1074@us.ibm.com> (raw)

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.

Signed-off-by: Don Fry <brazilnut@us.ibm.com>

--- linux-2.4.30/drivers/net/orig.pcnet32.c	2005-01-19 06:09:56.000000000 -0800
+++ linux-2.4.30/drivers/net/pcnet32.c	2005-04-29 14:14:28.000000000 -0700
@@ -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 <psimmons@flash.net> 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 */
 
-- 
Don Fry
brazilnut@us.ibm.com

             reply	other threads:[~2005-04-29 21:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-29 21:49 Don Fry [this message]
2005-08-19  6:22 ` [PATCH 2.4.30] pcnet32: fix resource leak with loopback test Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050429214956.GA1074@us.ibm.com \
    --to=brazilnut@us.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).