From: Sudeep Holla <sudeep.holla@arm.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
Sudeep Holla <sudeep.holla@arm.com>,
Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>,
cristian.marussi@arm.com, arm-scmi@vger.kernel.org
Subject: Re: [PATCH] firmware: arm_scmi: fix an OF node reference leak in scmi_txrx_setup()
Date: Tue, 17 Dec 2024 14:27:26 +0000 [thread overview]
Message-ID: <Z2GKTp3VE_uK1pQv@bogus> (raw)
In-Reply-To: <4c4d130b-3fd0-4339-a005-23472c82625a@kernel.org>
On Tue, Dec 17, 2024 at 11:50:27AM +0100, Krzysztof Kozlowski wrote:
> On 17/12/2024 06:51, Dan Carpenter wrote:
> > On Tue, Dec 17, 2024 at 11:31:22AM +0900, Joe Hattori wrote:
> >> scmi_txrx_setup() calls scmi_chan_setup(), which increments the refcount
> >> of the given OF node. When the Rx channel setup fails with ENOMEM,
> >> scmi_chan_setup() returns the error, but does not release the OF node
> >> obtained in the Tx channel setup. Thus, add an of_node_put() call when
> >> the Rx setup fails with ENOMEM.
> >>
> >> This bug was found by an experimental static analysis tool that I am
> >> developing.
> >>
> >
> > No, the patch is wrong.
> >
> There are more patches like this without understanding the OF
> drop/retain reference behavior. I suggest careful review of all results
> of this "static analysis tool".
>
Thanks Dan and Krzysztof for the quick heads up and suggestions. Much
appreciated.
--
Regards,
Sudeep
prev parent reply other threads:[~2024-12-17 14:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 2:31 [PATCH] firmware: arm_scmi: fix an OF node reference leak in scmi_txrx_setup() Joe Hattori
2024-12-17 5:51 ` Dan Carpenter
2024-12-17 10:50 ` Krzysztof Kozlowski
2024-12-17 14:27 ` Sudeep Holla [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=Z2GKTp3VE_uK1pQv@bogus \
--to=sudeep.holla@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=dan.carpenter@linaro.org \
--cc=joe@pf.is.s.u-tokyo.ac.jp \
--cc=krzk@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