i2c: fsi: Add of_put_node() before break
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Sat, 6 Jul 2019 13:19:11 +0000 (18:49 +0530)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 3 Sep 2019 18:33:43 +0000 (20:33 +0200)
commit0a321b97368aa0567f238207eeb19cc8cbb6a7e2
treea51843bf9edb029a1115daf31d82f3abf1649280
parent7077ad2ee316551b4ba9602838d09b67683e20b6
i2c: fsi: Add of_put_node() before break

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

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Reviewed-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-fsi.c