[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <504e431b900341249d331b868d90312cf41f415a.1618947919.git.christophe.jaillet@wanadoo.fr>
Date: Tue, 20 Apr 2021 21:46:13 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: eajames@...ux.ibm.com, broonie@...nel.org
Cc: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] spi: fsi: add a missing of_node_put
'for_each_available_child_of_node' performs an of_node_get on each
iteration, so a return from the middle of the loop requires an of_node_put.
Fixes: bbb6b2f9865b ("spi: Add FSI-attached SPI controller driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
drivers/spi/spi-fsi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c
index de359718e816..87f8829c3995 100644
--- a/drivers/spi/spi-fsi.c
+++ b/drivers/spi/spi-fsi.c
@@ -566,8 +566,10 @@ static int fsi_spi_probe(struct device *dev)
continue;
ctlr = spi_alloc_master(dev, sizeof(*ctx));
- if (!ctlr)
+ if (!ctlr) {
+ of_node_put(np);
break;
+ }
ctlr->dev.of_node = np;
ctlr->num_chipselect = of_get_available_child_count(np) ?: 1;
--
2.27.0
Powered by blists - more mailing lists