Skip to content
Commit 4d02423e authored by Boris Brezillon's avatar Boris Brezillon
Browse files

mtd: nand: gpmi: Fix gpmi_nand_init() error path



The GPMI driver is wrongly assuming that nand_release() can safely be
called on an uninitialized/unregistered NAND device.

Add a new err_nand_cleanup label in the error path and only execute if
nand_scan_tail() succeeded.

Note that we now call nand_cleanup() instead of nand_release()
(nand_release() is actually grouping the mtd_device_unregister() and
nand_cleanup() in one call) because there's no point in trying to
unregister a device that has never been registered.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: default avatarMarek Vasut <marek.vasut@gmail.com>
Acked-by: default avatarHan Xu <han.xu@nxp.com>
Reviewed-by: default avatarMarek Vasut <marek.vasut@gmail.com>
parent d7e578c8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment