summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-04-29 08:05:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-04-29 08:05:17 +0200
commit3fafc8e5c702828b783f6b66bccfd5c40db98fd9 (patch)
treea75fa0d033b7e35ab081d9490f7b3f740e96db03
parent49059486958c2f43a134ec08210c10cee209f596 (diff)
downloadbarebox-3fafc8e5c702828b783f6b66bccfd5c40db98fd9.tar.gz
mtd: nand-bb: use list_for_each_entry_safe
We need list_for_each_entry_safe in dev_remove_bb_dev since the list entries are removed during iteration over the list. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Alexander Aring <alex.aring@gmail.com>
-rw-r--r--drivers/mtd/nand/nand-bb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c
index f387ef6..89d5945 100644
--- a/drivers/mtd/nand/nand-bb.c
+++ b/drivers/mtd/nand/nand-bb.c
@@ -308,9 +308,9 @@ out1:
int dev_remove_bb_dev(const char *name)
{
- struct nand_bb *bb;
+ struct nand_bb *bb, *tmp;
- list_for_each_entry(bb, &bb_list, list) {
+ list_for_each_entry_safe(bb, tmp, &bb_list, list) {
if (!strcmp(bb->cdev.name, name)) {
devfs_remove(&bb->cdev);
cdev_close(bb->cdev_parent);