]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
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)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 7 Dec 2024 17:28:39 +0000 (17:28 +0000)
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>
drivers/iio/adc/at91_adc.c

index a3f0a232166613239abd58652339a433698c86f2..5927756b749a2473e979133fac955cdfd5faaa4d 100644 (file)
@@ -979,7 +979,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;
 }