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
Subject[2.4] Memleak in Aironet 4500 Pcmcia driver
Hello!

There is a memleak in Aironet 4500 Pcmcia driver on error exit path
that is trivial to fix.
Please consider following path.
Found with help of smatch's unfree script.

Bye,
Oleg
===== drivers/net/pcmcia/aironet4500_cs.c 1.8 vs edited =====
--- 1.8/drivers/net/pcmcia/aironet4500_cs.c Wed Aug 7 22:27:37 2002
+++ edited/drivers/net/pcmcia/aironet4500_cs.c Tue Apr 22 23:40:53 2003
@@ -282,7 +282,7 @@
};
memset(dev,0,sizeof(struct net_device));
dev->priv = kmalloc(sizeof(struct awc_private), GFP_KERNEL);
- if (!dev->priv ) {printk(KERN_CRIT "out of mem on dev priv alloc \n"); return NULL;};
+ if (!dev->priv ) {printk(KERN_CRIT "out of mem on dev priv alloc \n"); kfree(dev); return NULL;};
memset(dev->priv,0,sizeof(struct awc_private));

// link->dev->minor = dev->minor;
-
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:0.032 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site