iio: adc: gyroadc: fix leak of device node iterator
authorTobias Jordan <kernel@cdqe.de>
Sat, 26 Sep 2020 16:19:46 +0000 (18:19 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 29 Sep 2020 16:50:51 +0000 (17:50 +0100)
commitda4410d4078ba4ead9d6f1027d6db77c5a74ecee
tree7ec56cb4f676c67d904f73142c6c245338375d92
parentc537d3457542a398caa1fe58e0976c5f83cf7281
iio: adc: gyroadc: fix leak of device node iterator

Add missing of_node_put calls when exiting the for_each_child_of_node
loop in rcar_gyroadc_parse_subdevs early.

Also add goto-exception handling for the error paths in that loop.

Fixes: 059c53b32329 ("iio: adc: Add Renesas GyroADC driver")
Signed-off-by: Tobias Jordan <kernel@cdqe.de>
Link: https://lore.kernel.org/r/20200926161946.GA10240@agrajag.zerfleddert.de
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/rcar-gyroadc.c