summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>2024-12-07 13:30:45 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-17 13:34:46 +0100
commit25ef52f1c15db67d890b80203a911b9a57b0bf71 (patch)
tree4cfe0aecccc75ed4e1f05b8ccc55e086993e8280
parent26016d08c42ccd4052d6a4e5e7845f1eff208d7c (diff)
downloadlinux-25ef52f1c15db67d890b80203a911b9a57b0bf71.tar.gz
linux-25ef52f1c15db67d890b80203a911b9a57b0bf71.tar.bz2
linux-25ef52f1c15db67d890b80203a911b9a57b0bf71.zip
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>
-rw-r--r--drivers/iio/adc/at91_adc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 366e252ebeb0..ff61b7649113 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -985,7 +985,7 @@ static int at91_ts_register(struct iio_dev *idev,
return ret;
err:
- input_free_device(st->ts_input);
+ input_free_device(input);
return ret;
}