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>
This commit is contained in:
parent
4905948695
commit
3fafc8e5c7
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue