Skip to content

Commit

Permalink
[MTD] Use after free, found by the Coverity tool
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joern Engel authored and Thomas Gleixner committed May 23, 2005
1 parent 3b88775 commit d30f11d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/mtd/devices/phram.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* $Id: phram.c,v 1.11 2005/01/05 18:05:13 dwmw2 Exp $
* $Id: phram.c,v 1.12 2005/02/23 19:37:07 joern Exp $
*
* Copyright (c) ???? Jochen Schäuble <psionic@psionic.de>
* Copyright (c) 2003-2004 Jörn Engel <joern@wh.fh-wedel.de>
Expand Down Expand Up @@ -107,9 +107,9 @@ static int phram_write(struct mtd_info *mtd, loff_t to, size_t len,

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);
Expand Down

0 comments on commit d30f11d

Please sign in to comment.