Linux I2C development
 help / color / mirror / Atom feed
* [GIT PULL] rust-i2c-fixes for 7.1-rc7
@ 2026-06-06 17:39 Igor Korotin
  2026-06-08  7:51 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Korotin @ 2026-06-06 17:39 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel

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(-)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-08  7:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-06 17:39 [GIT PULL] rust-i2c-fixes for 7.1-rc7 Igor Korotin
2026-06-08  7:51 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox