From: Igor Korotin <igor.korotin@linux.dev>
To: Wolfram Sang <wsa@kernel.org>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL] rust-i2c-fixes for 7.1-rc7
Date: Sat, 6 Jun 2026 18:39:19 +0100 [thread overview]
Message-ID: <9e49b71b-8b60-479e-93e7-5c12e352c78e@linux.dev> (raw)
The following changes since commit e43ffb69e0438cddd72aaa30898b4dc446f664f8:
Linux 7.1-rc6 (2026-05-31 15:14:24 -0700)
are available in the Git repository at:
https://github.com/ikrtn/linux.git tags/rust-i2c-7.1-rc7
for you to fetch changes up to 4eb422482ca5d924d7212ad2ca1cb7ea6f5b524d:
rust: i2c: fix I2cAdapter refcounts double increment (2026-06-06
15:19:27 +0100)
----------------------------------------------------------------
rust: i2c: fix I2cAdapter refcount double increment
A single bugfix for the Rust I2C abstractions, targeting 7.1.
`I2cAdapter::get` calls `i2c_get_adapter()` which returns a pointer with
an already-incremented refcount. The code then converts the raw pointer to
an `ARef` via `.into()`, which calls `inc_ref()` again through the
`From<&T> for ARef<T>` impl — resulting in a leaked device and module
reference on every call.
The fix uses `ARef::from_raw()` instead, which takes ownership of the
existing refcount without incrementing it.
Signed-off-by: Igor Korotin <igor.korotin@linux.dev>
----------------------------------------------------------------
Nicolás Antinori (1):
rust: i2c: fix I2cAdapter refcounts double increment
rust/kernel/i2c.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
next reply other threads:[~2026-06-06 17:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-06 17:39 Igor Korotin [this message]
2026-06-08 7:51 ` [GIT PULL] rust-i2c-fixes for 7.1-rc7 Wolfram Sang
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=9e49b71b-8b60-479e-93e7-5c12e352c78e@linux.dev \
--to=igor.korotin@linux.dev \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa@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