mtd/drivers/mtd/devices phram.c,1.11,1.12

joern at infradead.org joern at infradead.org
Wed Feb 23 14:37:11 EST 2005


Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/home/joern/mtd/drivers/mtd/devices

Modified Files:
	phram.c 
Log Message:
Use after free, found by the Coverity tool 

Signed-off-by: Alexander Nyberg <alexn at dsv.su.se>   



Index: phram.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/phram.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- phram.c	5 Jan 2005 18:05:13 -0000	1.11
+++ phram.c	23 Feb 2005 19:37:07 -0000	1.12
@@ -107,9 +107,9 @@
 
 static void unregister_devices(void)
 {
-	struct phram_mtd_list *this;
+	struct phram_mtd_list *this, *safe;
 
-	list_for_each_entry(this, &phram_list, list) {
+	list_for_each_entry_safe(this, safe, &phram_list, list) {
 		del_mtd_device(&this->mtd);
 		iounmap(this->mtd.priv);
 		kfree(this);





More information about the linux-mtd-cvs mailing list