* [PATCH] mtd: spi-nor: hisi-sfc: Put child node np on error path
@ 2021-01-21 9:18 ` Pan Bian
0 siblings, 0 replies; 4+ messages in thread
From: Pan Bian @ 2021-01-21 9:18 UTC (permalink / raw)
To: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Boris Brezillon, Lee Jones, Sergei Shtylyov
Cc: linux-mtd, linux-kernel, Pan Bian
Put the child node np when it fails to get or register device.
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
drivers/mtd/spi-nor/controllers/hisi-sfc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/controllers/hisi-sfc.c b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
index 7c26f8f565cb..47fbf1d1e557 100644
--- a/drivers/mtd/spi-nor/controllers/hisi-sfc.c
+++ b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
@@ -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");
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] mtd: spi-nor: hisi-sfc: Put child node np on error path
@ 2021-01-21 9:18 ` Pan Bian
0 siblings, 0 replies; 4+ messages in thread
From: Pan Bian @ 2021-01-21 9:18 UTC (permalink / raw)
To: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Boris Brezillon, Lee Jones, Sergei Shtylyov
Cc: Pan Bian, linux-mtd, linux-kernel
Put the child node np when it fails to get or register device.
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
drivers/mtd/spi-nor/controllers/hisi-sfc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/controllers/hisi-sfc.c b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
index 7c26f8f565cb..47fbf1d1e557 100644
--- a/drivers/mtd/spi-nor/controllers/hisi-sfc.c
+++ b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
@@ -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");
--
2.17.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: spi-nor: hisi-sfc: Put child node np on error path
2021-01-21 9:18 ` Pan Bian
@ 2021-01-25 7:09 ` Tudor Ambarus
-1 siblings, 0 replies; 4+ messages in thread
From: Tudor Ambarus @ 2021-01-25 7:09 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Boris Brezillon,
Lee Jones, Sergei Shtylyov, Miquel Raynal, Pan Bian
Cc: Tudor Ambarus, linux-mtd, linux-kernel
On Thu, 21 Jan 2021 01:18:47 -0800, Pan Bian wrote:
> 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,
--
Tudor Ambarus <tudor.ambarus@microchip.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: spi-nor: hisi-sfc: Put child node np on error path
@ 2021-01-25 7:09 ` Tudor Ambarus
0 siblings, 0 replies; 4+ messages in thread
From: Tudor Ambarus @ 2021-01-25 7:09 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Boris Brezillon,
Lee Jones, Sergei Shtylyov, Miquel Raynal, Pan Bian
Cc: linux-mtd, linux-kernel, Tudor Ambarus
On Thu, 21 Jan 2021 01:18:47 -0800, Pan Bian wrote:
> 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,
--
Tudor Ambarus <tudor.ambarus@microchip.com>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-25 7:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 9:18 [PATCH] mtd: spi-nor: hisi-sfc: Put child node np on error path Pan Bian
2021-01-21 9:18 ` Pan Bian
2021-01-25 7:09 ` Tudor Ambarus
2021-01-25 7:09 ` Tudor Ambarus
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.