mtd: rawnand: oxnas: Unregister all devices on error
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 19 May 2020 13:00:10 +0000 (15:00 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Sun, 31 May 2020 08:53:35 +0000 (10:53 +0200)
commitb60391eb17b2956ff2fc4c348e5a464da21ff9cb
tree0fc53bc3416c356bbd16366f3e71e5d768a26fd1
parent154298e2a3f6c9ce1d76cdb48d89fd5b107ea1a3
mtd: rawnand: oxnas: Unregister all devices on error

On error, the oxnas probe path just frees the device which failed and
aborts the probe, leaving unreleased resources.

Fix this situation by calling mtd_device_unregister()/nand_cleanup()
on these.

Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-38-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/oxnas_nand.c