]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mtd: rawnand: nuvoton: Fix an error handling path in ma35_nand_chips_init()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 30 Jul 2025 19:47:46 +0000 (21:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:37:35 +0000 (16:37 +0200)
commit0cd36f52fececd1ea7eea7172f3b673bb6576782
treeb7ede9d492065c37b8d59644270459b0173fecc8
parentc62608a41b3814382ae362f7886d2e54764a5984
mtd: rawnand: nuvoton: Fix an error handling path in ma35_nand_chips_init()

[ Upstream commit 1eae113dd5ff5192cfd3e11b6ab7b96193b42c01 ]

If a ma35_nand_chip_init() call fails, then a reference to 'nand_np' still
needs to be released.

Use for_each_child_of_node_scoped() to fix the issue.

Fixes: 5abb5d414d55 ("mtd: rawnand: nuvoton: add new driver for the Nuvoton MA35 SoC")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/nand/raw/nuvoton-ma35d1-nand-controller.c