Skip to content

Commit 24b5515

Browse files
tititiou36broonie
authored andcommitted
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: bbb6b2f ("spi: Add FSI-attached SPI controller driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/504e431b900341249d331b868d90312cf41f415a.1618947919.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 31ed8eb commit 24b5515

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/spi/spi-fsi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,10 @@ static int fsi_spi_probe(struct device *dev)
566566
continue;
567567

568568
ctlr = spi_alloc_master(dev, sizeof(*ctx));
569-
if (!ctlr)
569+
if (!ctlr) {
570+
of_node_put(np);
570571
break;
572+
}
571573

572574
ctlr->dev.of_node = np;
573575
ctlr->num_chipselect = of_get_available_child_count(np) ?: 1;

0 commit comments

Comments
 (0)