All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Yige Jiang <yigejiang86@gmail.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Wolfram Sang <wsa@kernel.org>,
	linuxppc-dev@lists.ozlabs.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] macintosh: therm_windtunnel: Fix i2c adapter reference leak in probe
Date: Wed, 25 Nov 2026 12:06:44 +0100	[thread overview]
Message-ID: <awbBRG6VMVKn0Dor@ninjato> (raw)
In-Reply-To: <rc-b1-20261110-vc-23-41d00428efcb@gmail.com>

On Wed, Nov 25, 2026 at 05:03:43PM +0800, Yige Jiang wrote:
> therm_of_probe() walks the i2c adapters with i2c_get_adapter() and
> drops each reference with i2c_put_adapter() before taking the next one.
> Once do_attach() has started the control loop, however, it returns 0
> while still holding the reference to the current adapter. The pointer
> is not stored anywhere, so that reference is never dropped. This
> happens on every successful probe, including after an unbind/rebind of
> the platform device, and the extra device reference would make
> i2c_del_adapter() for that bus wait forever for the adapter device to
> be released.
> 
> The driver does not use the adapter after do_attach() returns; the
> sensor clients it talks to afterwards are children of the adapter and
> are unregistered by i2c_del_adapter(). Drop the reference right after
> do_attach(), before checking x.running.
> 
> Fixes: 3e7bed52719d ("macintosh: therm_windtunnel: drop using attach_adapter")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yige Jiang <yigejiang86@gmail.com>

I require tests on HW for this one. Windtunnel support has always been
very fragile.


      reply	other threads:[~2026-11-25 11:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  9:03 [PATCH] macintosh: therm_windtunnel: Fix i2c adapter reference leak in probe Yige Jiang
2026-11-25 11:06 ` 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=awbBRG6VMVKn0Dor@ninjato \
    --to=wsa+renesas@sang-engineering.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=stable@vger.kernel.org \
    --cc=wsa@kernel.org \
    --cc=yigejiang86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.