From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Andi Shyti <andi.shyti@kernel.org>,
Liu Zhenlong <dragonliu2018@gmail.com>
Cc: linux-i2c@vger.kernel.org, stable@vger.kernel.org,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Robert Foss <rfoss@kernel.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Bjorn Andersson <andersson@kernel.org>,
Wolfram Sang <wsa@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] i2c: qcom-cci: fix device_node refcount leak in cci_probe()/cci_remove()
Date: Wed, 16 Sep 2026 10:36:33 +0200 [thread overview]
Message-ID: <7f812c3a-c933-4d43-98de-f4862bd042dd@oss.qualcomm.com> (raw)
In-Reply-To: <aqpNxZvYu8pDCchC@zenone.zhora.eu>
On 9/16/26 10:06 AM, Andi Shyti wrote:
> Hi Liu,
>
> On Wed, Aug 19, 2026 at 01:57:50AM +0800, Liu Zhenlong wrote:
>> The of_node_put() matching of_node_get() runs after i2c_del_adapter(),
>> whose trailing memset() zeroes adap->dev and thus adap->dev.of_node,
>> making the put a no-op and leaking the node on every adapter removal
>> and error cleanup.
>>
>> Use a devm action: the pointer is captured at registration, out of
>> reach of that memset(), and devres runs the put once on probe failure
>> and detach, replacing the three manual of_node_put() calls. The
>> setup loop uses the scoped iterator form so the child node is released
>> automatically if devm_add_action_or_reset() fails mid-loop.
>>
>> Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>> Fixes: 02a4a69667a2 ("i2c: qcom-cci: don't put a device tree node before i2c_add_adapter()")
>> Cc: stable@vger.kernel.org
>> Assisted-by: Claude:claude-opus-5
>> Signed-off-by: Liu Zhenlong <dragonliu2018@gmail.com>
>
> pushed to i2c/i2c-fixes.
>
> Please, next time don't send patches as --in-reply-to.
>
> We should train LLM's not to take much freedom as to send the
> next versions in the same threads.
The process is well documented, but the LLMs don't really seem
to care about the current chain of:
README.md:
find "Who are you / * AI Coding Assistant"
go to the "AI Coding Assistant" paragraph
read the link to "Documentation/process/coding-assistants.rst"
coding-assistants.rst:
read the links to process docs
read the whole file
Might be because we have no AGENTS.md/CLAUDE.md which the tools
look at by default. But it's not guaranteed that it'd be a
panaceum either
Konrad
prev parent reply other threads:[~2026-09-16 8:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-15 14:09 [PATCH] " Liu Zhenlong
2026-08-18 11:41 ` Konrad Dybcio
2026-08-18 17:57 ` [PATCH v2] " Liu Zhenlong
2026-08-18 23:18 ` Vladimir Zapolskiy
2026-09-16 8:06 ` Andi Shyti
2026-09-16 8:36 ` Konrad Dybcio [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=7f812c3a-c933-4d43-98de-f4862bd042dd@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=andi.shyti@kernel.org \
--cc=dragonliu2018@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=rfoss@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vladimir.zapolskiy@linaro.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
all inboxes | Powered by JetHome®