Skip to contentSkip to conversation

memory leak in irda/sa1100_ir.c

PATCH Applied Stephen Hemminger 2 participants 2 messages Oct 9, 2003 – Oct 10, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory leak in irda/sa1100_ir.c

This driver seems confused about what get done for it on module exit. It needs to free the network device it created.

Patch against 2.6.0-test7

drivers/net/irda/sa1100_ir.c +2 -6
diff -urN -X dontdiff linux-2.5/drivers/net/irda/sa1100_ir.c linux-2.5-net/drivers/net/irda/sa1100_ir.c
@@ -1132,12 +1132,8 @@
 	release_mem_region(__PREG(Ser2HSCR0), 0x1c);
 	release_mem_region(__PREG(Ser2UTCR0), 0x24);
 
-	/*
-	 * We now know that the netdevice is no longer in use, and all
-	 * references to our driver have been removed.  The only structure
-	 * which may still be present is the netdevice, which will get
-	 * cleaned up by net/core/dev.c
-	 */
+	if(dev)
+		free_netdev(dev);
 }
 
 static int __init sa1100ir_setup(char *line)
#1 lore raw
Quoted 2 lines · On Thu, 9 Oct 2003 09:37:52 -0700 Stephen Hemminger <[email protected]> wrote:

This driver seems confused about what get done for it on module exit. It needs to free the network device it created.

Applied, thanks Stephen.