From: Jonathan Cameron <jic23@kernel.org>
To: Felix Gu <ustc.gu@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Andy Shevchenko" <andriy.shevchenko@intel.com>
Subject: Re: [PATCH v2] iio: light: veml6070: Fix resource leak in probe error path
Date: Sun, 12 Apr 2026 16:58:43 +0100 [thread overview]
Message-ID: <20260412165843.64623b05@jic23-huawei> (raw)
In-Reply-To: <20260327-veml6070-v2-1-10c3c67eb171@gmail.com>
On Fri, 27 Mar 2026 20:27:54 +0800
Felix Gu <ustc.gu@gmail.com> wrote:
> The driver calls i2c_new_dummy_device() to create a dummy device,
> then calls i2c_smbus_write_byte(). If i2c_smbus_write_byte() fails and
> returns, the cleanup via devm_add_action_or_reset() was never registered,
> so the dummy device leaks.
>
> Switch to devm_i2c_new_dummy_device() which registers cleanup atomically
> with device creation, eliminating the error-path window.
>
> Fixes: 7501bff87c3e ("iio: light: veml6070: add action for i2c_unregister_device")
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.
Thanks,
Jonathan
prev parent reply other threads:[~2026-04-12 15:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 12:27 [PATCH v2] iio: light: veml6070: Fix resource leak in probe error path Felix Gu
2026-04-12 15:58 ` Jonathan Cameron [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=20260412165843.64623b05@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=ustc.gu@gmail.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