]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: at91: call input_free_device() on allocated iio_dev
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Sat, 7 Dec 2024 04:30:45 +0000 (13:30 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2025 16:15:55 +0000 (17:15 +0100)
commit028a1ba8e3bae593d701aee4f690ce7c195b67d6
tree1f2871d382f8f63566cd1197d698db55f1422cd7
parent060214459b631effc465f3f799db8360352cdc5e
iio: adc: at91: call input_free_device() on allocated iio_dev

commit de6a73bad1743e9e81ea5a24c178c67429ff510b upstream.

Current implementation of at91_ts_register() calls input_free_deivce()
on st->ts_input, however, the err label can be reached before the
allocated iio_dev is stored to st->ts_input. Thus call
input_free_device() on input instead of st->ts_input.

Fixes: 84882b060301 ("iio: adc: at91_adc: Add support for touchscreens without TSMR")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://patch.msgid.link/20241207043045.1255409-1-joe@pf.is.s.u-tokyo.ac.jp
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/at91_adc.c