mtd: rawnand: tango: Add of_node_put() before return
commita08e42987118952c98707f0b29cf0e5f4fd2e00b
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Tue, 9 Jul 2019 17:13:16 +0000 (9 22:43 +0530)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 25 Jul 2019 12:21:44 +0000 (25 14:21 +0200)
tree157237101395a25b9b785c2cf5efa7883219a2e2
parentc436f68beeb20f2f92937677db1d9069b0dd2a3d
mtd: rawnand: tango: Add of_node_put() before return

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

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Acked-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/tango_nand.c