From: Jonathan Cameron <jic23@kernel.org>
To: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Cc: lars@metafoo.de, nicolas.ferre@microchip.com,
alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev,
linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: adc: at91: call input_free_device() on allocated iio_dev
Date: Sat, 7 Dec 2024 17:30:46 +0000 [thread overview]
Message-ID: <20241207173046.375dd855@jic23-huawei> (raw)
In-Reply-To: <20241207043045.1255409-1-joe@pf.is.s.u-tokyo.ac.jp>
On Sat, 7 Dec 2024 13:30:45 +0900
Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp> wrote:
> 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>
Hi Joe.
Good catch. Longer term I'd like this driver to be fully converted to devm
managed cleanup though which would have made this bug go away.
However, having looked at it, that conversion is a rather substantial, if simple
patch, so I'm fine taking this fix and maybe someone will revisit to do that
cleanup later.
Applied and marked for stable.
thanks,
Jonathan
> ---
> drivers/iio/adc/at91_adc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> index a3f0a2321666..5927756b749a 100644
> --- a/drivers/iio/adc/at91_adc.c
> +++ b/drivers/iio/adc/at91_adc.c
> @@ -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;
> }
>
next prev parent reply other threads:[~2024-12-07 17:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-07 4:30 [PATCH] iio: adc: at91: call input_free_device() on allocated iio_dev Joe Hattori
2024-12-07 17:30 ` Jonathan Cameron [this message]
2024-12-07 18:58 ` Andy Shevchenko
2024-12-07 19:05 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241207173046.375dd855@jic23-huawei \
--to=jic23@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=joe@pf.is.s.u-tokyo.ac.jp \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox