linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.4] Memleak in Aironet 4500 Pcmcia driver
@ 2003-04-22 19:45 Oleg Drokin
  0 siblings, 0 replies; only message in thread
From: Oleg Drokin @ 2003-04-22 19:45 UTC (permalink / raw)
  To: alan, linux-kernel, marcelo

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;

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

only message in thread, other threads:[~2003-04-22 19:34 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:45 [2.4] Memleak in Aironet 4500 Pcmcia driver Oleg Drokin

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).