lkml.org 
[lkml]   [2003]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectMemleak fix for DIGITAL EtherWORKS 3 ethernet driver
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));
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:34    [W:4.473 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site