mtd: spi-nor: hisi-sfc: Put child node np on error path
Subsystems (2)
PATCH 1/1 mtd: spi-nor: hisi-sfc: Put child node np on error path
Put the child node np when it fails to get or register device.
Signed-off-by Pan Bian <[email protected]>
--- drivers/mtd/spi-nor/controllers/hisi-sfc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/controllers/hisi-sfc.c +3 -1
@@ -399,8 +399,10 @@ static int hisi_spi_nor_register_all(struct hifmc_host *host)for_each_available_child_of_node (dev->of_node, np) { ret =hisi_spi_nor_register (np, host); -if (ret) +if (ret) { +of_node_put (np); goto fail; + }if (host->num_chip ==HIFMC_MAX_CHIP_NUM ) {dev_warn (dev,"Flash device number exceeds the maximum chipselect number\n" );
Signature · 7 lines
2.17.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Tudor Ambarus
AppliedQuoted 1 line · Pan Bian
Put the child node np when it fails to get or register device.
Applied to spi-nor/next, thanks!
[1/1] mtd: spi-nor: hisi-sfc: Put child node np on error path
https://git.kernel.org/mtd/c/fe6653460ee7
Best regards,
Signature · 5 lines
Tudor Ambarus <[email protected]> ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/