From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
samuel@sholland.org, stable@vger.kernel.org
Subject: Re: [PATCH] Input: Fix i2c_bus OF node reference leak in ppkb_probe()
Date: Thu, 17 Sep 2026 08:12:37 -0700 [thread overview]
Message-ID: <aqwBtYAcIiwSSMmK@google.com> (raw)
In-Reply-To: <20260916184721.2093344-1-vulab@iscas.ac.cn>
Hi Wentao,
On Wed, Sep 16, 2026 at 06:47:21PM +0000, Wentao Liang wrote:
> The device node reference returned by of_get_child_by_name() is
> stored as the adapter's of_node but never released, leaking one node
> reference on every probe, successful or not.
>
> The adapter only borrows the node, so drop the reference once the
> adapter has been added, and also on the error path.
I do not think this is correct fix. The node assigned to the adapter
should stay alive while the adapter is alive.
I think we should convert of_node to fwnode, use device_set_node() to
make sure both fwnode and of_node are pointing to the same thing, and
set up devm_add_action_or_reset() to free the fwnode at the right time.
Thanks.
--
Dmitry
prev parent reply other threads:[~2026-09-17 15:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 18:47 [PATCH] Input: Fix i2c_bus OF node reference leak in ppkb_probe() Wentao Liang
2026-09-17 15:12 ` Dmitry Torokhov [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=aqwBtYAcIiwSSMmK@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samuel@sholland.org \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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.