mtd: rawnand: oxnas: Add of_node_put()
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Tue, 9 Jul 2019 17:10:16 +0000 (22:40 +0530)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 25 Jul 2019 12:21:44 +0000 (14:21 +0200)
commitc436f68beeb20f2f92937677db1d9069b0dd2a3d
treee3f28c61259c14331eb2f152a2a7261e9fc01746
parent4902e87faf26067d661e2a9285ce93457884da6d
mtd: rawnand: oxnas: Add of_node_put()

Each iteration of for_each_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 under a new goto to put
the node at a loop exit.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/oxnas_nand.c