aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/phram.c
diff options
context:
space:
mode:
authorJoern Engel <joern@wohnheim.fh-wedel.de>2005-02-23 14:37:11 -0500
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 06:43:32 -0400
commitd30f11d22549c54e9b05d153e37d166f88a2aa43 (patch)
treeae9c557262678328cad49d96aa4b8a879a3a911d /drivers/mtd/devices/phram.c
parent3b88775c7504dfdedd5f267cb8f02999e380222a (diff)
[MTD] Use after free, found by the Coverity tool
Signed-off-by: Alexander Nyberg <alexn@dsv.su.se> Signed-off-by: Joern Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/devices/phram.c')
-rw-r--r--drivers/mtd/devices/phram.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index 5f8e164ddb71..57454df639fb 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -1,5 +1,5 @@
1/** 1/**
2 * $Id: phram.c,v 1.11 2005/01/05 18:05:13 dwmw2 Exp $ 2 * $Id: phram.c,v 1.12 2005/02/23 19:37:07 joern Exp $
3 * 3 *
4 * Copyright (c) ???? Jochen Schäuble <psionic@psionic.de> 4 * Copyright (c) ???? Jochen Schäuble <psionic@psionic.de>
5 * Copyright (c) 2003-2004 Jörn Engel <joern@wh.fh-wedel.de> 5 * Copyright (c) 2003-2004 Jörn Engel <joern@wh.fh-wedel.de>
@@ -107,9 +107,9 @@ static int phram_write(struct mtd_info *mtd, loff_t to, size_t len,
107 107
108static void unregister_devices(void) 108static void unregister_devices(void)
109{ 109{
110 struct phram_mtd_list *this; 110 struct phram_mtd_list *this, *safe;
111 111
112 list_for_each_entry(this, &phram_list, list) { 112 list_for_each_entry_safe(this, safe, &phram_list, list) {
113 del_mtd_device(&this->mtd); 113 del_mtd_device(&this->mtd);
114 iounmap(this->mtd.priv); 114 iounmap(this->mtd.priv);
115 kfree(this); 115 kfree(this);