From: Stephen Boyd <sboyd@kernel.org>
To: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>, mchehab+huawei@kernel.org
Cc: linux-kernel@vger.kernel.org, krzk@kernel.org,
Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Subject: Re: [PATCH v3] spmi: hisi-spmi-controller: manage the OF node reference in device initialization and cleanup
Date: Tue, 07 Jan 2025 11:49:21 -0800 [thread overview]
Message-ID: <197c4149efbfa24dee4711923cbddff4.sboyd@kernel.org> (raw)
In-Reply-To: <20241219013507.1939266-1-joe@pf.is.s.u-tokyo.ac.jp>
Quoting Joe Hattori (2024-12-18 17:35:07)
> spmi_controller_probe() increments the refcount of an OF node, but does
> not release it. Instead, call of_node_get() in spmi_controller_alloc()
> and release it in spmi_ctrl_release() to avoid the reference leak. Also
> remove the lines in spmi_pmic_arb_bus_init() and spmi_controller_probe()
> where a pdev's of_node is stored after spmi_controller_alloc() is
> called, since the node is already set with an incremented refcount in
> spmi_controller_alloc(). Those lines do not overwrite the of_node since
> they set the same node that the spmi_controller_alloc() does, but are
> confusing at the very least.
>
> This bug was found by an experimental verification tool that I am
> developing.
>
> Fixes: e562cf3aea3e ("spmi: hisi-spmi-controller: move driver from staging")
> Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
> ---
Applied to spmi-next
prev parent reply other threads:[~2025-01-07 19:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 1:35 [PATCH v3] spmi: hisi-spmi-controller: manage the OF node reference in device initialization and cleanup Joe Hattori
2025-01-07 19:49 ` Stephen Boyd [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=197c4149efbfa24dee4711923cbddff4.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=joe@pf.is.s.u-tokyo.ac.jp \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@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 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.