mtd: rawnand: atmel: Fix error handling path in atmel_nand_controller_add_nands
Subsystems (4)
PATCH 1/1 mtd: rawnand: atmel: Fix error handling path in atmel_nand_controller_add_nands
If atmel_nand_create() fails, then reference to "nand_np" still need to be released.
Use for_each_child_of_node_scoped() to fix the issue.
Fixes f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Signed-off-by Erick Karanja <[email protected]>
--- drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +1 -1
@@ -1885,7 +1885,7 @@ static int atmel_nand_controller_add_nands(struct atmel_nand_controller *nc) reg_cells += val; -for_each_child_of_node (np, nand_np) { +for_each_child_of_node_scoped (np, nand_np) {struct atmel_nand *nand; nand =atmel_nand_create (nc, nand_np, reg_cells);
Signature · 1 line
2.43.0