]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: men_z188_adc: Fix a resource leak in an error handling path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 29 Jan 2022 08:32:47 +0000 (09:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Mar 2022 10:38:15 +0000 (11:38 +0100)
commit53d43a9c8dd224e66559fe86af1e473802c7130e
tree19febb76ca81e3d9f4c0e0366e77413d33a3cf3d
parente6a2e27cc946567728374b881196ee4eace9683f
iio: adc: men_z188_adc: Fix a resource leak in an error handling path

commit e0a2e37f303828d030a83f33ffe14b36cb88d563 upstream.

If iio_device_register() fails, a previous ioremap() is left unbalanced.

Update the error handling path and add the missing iounmap() call, as
already done in the remove function.

Fixes: 74aeac4da66f ("iio: adc: Add MEN 16z188 ADC driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/320fc777863880247c2aff4a9d1a54ba69abf080.1643445149.git.christophe.jaillet@wanadoo.fr
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/men_z188_adc.c