mtd: rawnand: vf610: Add of_node_put() before goto

Each iteration of for_each_available_child_of_node puts the previous
node, but in the case of a goto from the middle of the loop, there is no
put, thus causing a memory leak. Hence add an of_node_put before the
goto.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
Nishka Dasgupta 2019-07-09 22:38:37 +05:30 committed by Miquel Raynal
parent b410f4eb01
commit 4902e87faf

View File

@ -862,6 +862,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
dev_err(nfc->dev, dev_err(nfc->dev,
"Only one NAND chip supported!\n"); "Only one NAND chip supported!\n");
err = -EINVAL; err = -EINVAL;
of_node_put(child);
goto err_disable_clk; goto err_disable_clk;
} }