From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Felix Gu <ustc.gu@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"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
Subject: Re: [PATCH] iio: light: veml6070: Fix resource leak in probe error path
Date: Thu, 26 Mar 2026 20:40:17 +0200 [thread overview]
Message-ID: <acV9kcmPr9Xegd9O@ashevche-desk.local> (raw)
In-Reply-To: <20260326-veml6070-v1-1-5d79022e76f1@gmail.com>
On Thu, Mar 26, 2026 at 08:11:42PM +0800, Felix Gu wrote:
> The original code registered the i2c dummy device cleanup via
> devm_add_action_or_reset() after i2c_new_dummy_device(). If probe
> failed between these two calls, the dummy device would leak.
I see what you meant by reading the code, but the above is simply wrong.
The
ret = i2c_new_dummy_device();
if (ret)
return ret; // "probe failed between these two calls"
ret = devm_add_action_or_reset();
Please, rephrase.
> Use devm_i2c_new_dummy_device() which registers cleanup atomically
> with device creation, eliminating the error-path window.
With the fixed commit message
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-03-26 18:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 12:11 Felix Gu
2026-03-26 18:40 ` Andy Shevchenko [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=acV9kcmPr9Xegd9O@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jic23@kernel.org \
--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
all inboxes | Powered by JetHome®