From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Cc: linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: core: fix reference leak in i2c_register_adapter()
Date: Thu, 9 Jan 2025 11:02:17 +0100 [thread overview]
Message-ID: <Z3-eqecAEowpTF6P@shikoro> (raw)
In-Reply-To: <20241211030803.191789-1-joe@pf.is.s.u-tokyo.ac.jp>
[-- Attachment #1: Type: text/plain, Size: 529 bytes --]
On Wed, Dec 11, 2024 at 12:08:03PM +0900, Joe Hattori wrote:
> The reference count of the device incremented in device_initialize() is
> not decremented when device_add() fails. Add a put_device() call before
> returning from the function.
>
> This bug was found by an experimental static analysis tool that I am
> developing.
>
> Fixes: 60f68597024d ("i2c: core: Setup i2c_adapter runtime-pm before calling device_add()")
> Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2025-01-09 10:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 3:08 [PATCH] i2c: core: fix reference leak in i2c_register_adapter() Joe Hattori
2025-01-09 10:02 ` Wolfram Sang [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=Z3-eqecAEowpTF6P@shikoro \
--to=wsa+renesas@sang-engineering.com \
--cc=joe@pf.is.s.u-tokyo.ac.jp \
--cc=linux-i2c@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).