From d30f11d22549c54e9b05d153e37d166f88a2aa43 Mon Sep 17 00:00:00 2001 From: Joern Engel Date: Wed, 23 Feb 2005 19:37:11 +0000 Subject: [PATCH] [MTD] Use after free, found by the Coverity tool Signed-off-by: Alexander Nyberg Signed-off-by: Joern Engel Signed-off-by: Thomas Gleixner --- drivers/mtd/devices/phram.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c index 5f8e164ddb7..57454df639f 100644 --- a/drivers/mtd/devices/phram.c +++ b/drivers/mtd/devices/phram.c @@ -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 * Copyright (c) 2003-2004 Jörn Engel @@ -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); -- 2.11.4.GIT