Commit d30f11d2 authored by Joern Engel's avatar Joern Engel Committed by Thomas Gleixner

[MTD] Use after free, found by the Coverity tool

Signed-off-by: default avatarAlexander Nyberg <alexn@dsv.su.se>
Signed-off-by: default avatarJoern Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 3b88775c
/** /**
* $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 Schuble <psionic@psionic.de> * Copyright (c) ???? Jochen Schuble <psionic@psionic.de>
* Copyright (c) 2003-2004 Jrn Engel <joern@wh.fh-wedel.de> * Copyright (c) 2003-2004 Jrn 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,9 +107,9 @@ static int phram_write(struct mtd_info *mtd, loff_t to, size_t len,
static void unregister_devices(void) 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); del_mtd_device(&this->mtd);
iounmap(this->mtd.priv); iounmap(this->mtd.priv);
kfree(this); kfree(this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment