iio: adc: imx25-gcq: Fix leak of device_node in mx25_gcq_setup_cfgs()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 21 Sep 2018 21:58:02 +0000 (00:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:15:08 +0000 (11:15 -0800)
commit39b6d86b316e5d3d338d661ab6468beef1b5bb91
tree8cf2325814ed351e74f309ff0003e9c184553f0c
parent8b38d82b0d278d5725e02e470f3cdd46423ba7b1
iio: adc: imx25-gcq: Fix leak of device_node in mx25_gcq_setup_cfgs()

commit d3fa21c73c391975488818b085b894c2980ea052 upstream.

Leaving for_each_child_of_node loop we should release child device node,
if it is not stored for future use.

Found by Linux Driver Verification project (linuxtesting.org).

JC: I'm not sending this as a quick fix as it's been wrong for years,
but good to pick up for stable after the merge window.

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 6df2e98c3ea56 ("iio: adc: Add imx25-gcq ADC driver")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/fsl-imx25-gcq.c