All of lore.kernel.org
 help / color / mirror / Atom feed
* Memleak fix for DIGITAL EtherWORKS 3 ethernet driver
@ 2003-04-22 19:38 Oleg Drokin
  0 siblings, 0 replies; only message in thread
From: Oleg Drokin @ 2003-04-22 19:38 UTC (permalink / raw)
  To: alan, torvalds, linux-kernel, marcelo

Hello!

   There is a memleak on error exit path that is trivial to fix.
   The problem is present both in 2.4 and 2.5, the same patch applies.

   Please consider applying.

Bye,
    Oleg

===== drivers/net/ewrk3.c 1.20 vs edited =====
--- 1.20/drivers/net/ewrk3.c	Tue Dec  3 04:22:09 2002
+++ edited/drivers/net/ewrk3.c	Tue Apr 22 23:33:40 2003
@@ -1972,7 +1972,10 @@
 	case EWRK3_GET_STATS: { /* Get the driver statistics */
 		struct ewrk3_stats *tmp_stats =
         		kmalloc(sizeof(lp->pktStats), GFP_KERNEL);
-		if (!tmp_stats) return -ENOMEM;
+		if (!tmp_stats) {
+			status = -ENOMEM;
+			break;
+		}
 
 		spin_lock_irqsave(&lp->hw_lock, flags);
 		memcpy(tmp_stats, &lp->pktStats, sizeof(lp->pktStats));

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-22 19:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-22 19:38 Memleak fix for DIGITAL EtherWORKS 3 ethernet driver Oleg Drokin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.