From: Oliver Graute <oliver.graute@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Felix Kaechele" <felix@kaechele.ca>,
"Andreas Kemnade" <andreas@kemnade.info>,
"Li Zetao" <lizetao1@huawei.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: edt-ft5x06 - fix regmap leak when probe fails
Date: Wed, 23 Oct 2024 13:46:43 +0200 [thread overview]
Message-ID: <ZxjiI3at4r+QGBMK@graute-think> (raw)
In-Reply-To: <ZxL6rIlVlgsAu-Jv@google.com>
On 18/10/24, Dmitry Torokhov wrote:
> The driver neglects to free the instance of I2C regmap constructed at
> the beginning of the edt_ft5x06_ts_probe() method when probe fails.
> Additionally edt_ft5x06_ts_remove() is freeing the regmap too early,
> before the rest of the device resources that are managed by devm are
> released.
>
> Fix this by installing a custom devm action that will ensure that the
> regmap is released at the right time during normal teardown as well as
> in case of probe failure.
>
> Note that devm_regmap_init_i2c() could not be used because the driver
> may replace the original regmap with a regmap specific for M06 devices
> in the middle of the probe, and using devm_regmap_init_i2c() would
> result in releasing the M06 regmap too early.
>
> Reported-by: Li Zetao <lizetao1@huawei.com>
> Fixes: 9dfd9708ffba ("Input: edt-ft5x06 - convert to use regmap API")
> Cc: stable@vger.kernel.org
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Oliver Graute <oliver.graute@kococonnector.com>
prev parent reply other threads:[~2024-10-23 11:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-19 0:17 [PATCH] Input: edt-ft5x06 - fix regmap leak when probe fails Dmitry Torokhov
2024-10-23 11:46 ` Oliver Graute [this message]
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=ZxjiI3at4r+QGBMK@graute-think \
--to=oliver.graute@gmail.com \
--cc=andreas@kemnade.info \
--cc=dmitry.torokhov@gmail.com \
--cc=felix@kaechele.ca \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizetao1@huawei.com \
--cc=u.kleine-koenig@baylibre.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