From: Viresh Kumar <viresh.kumar@linaro.org>
To: Bilal Hashim <AeeSec@126.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>,
Miguel Ojeda <ojeda@kernel.org>,
Alice Ryhl <aliceryhl@google.com>,
linux-pm@vger.kernel.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] rust: opp: clone cpumask before adding OF table in from_of_cpumask()
Date: Thu, 3 Dec 2026 15:39:33 +0530 [thread overview]
Message-ID: <axE_3fYK40Xsi643@vireshk-B250M-D3H> (raw)
In-Reply-To: <179604464473.13032.3572169864639839233@126.com>
On 30-11-26, 21:17, Bilal Hashim wrote:
> In Table::from_of_cpumask(), CpumaskVar::try_clone(cpumask) is currently
> called after bindings::dev_pm_opp_of_cpumask_add_table() succeeds. If
> the cpumask allocation fails, Table is dropped before table.cpus is set,
> so Drop does not call dev_pm_opp_of_cpumask_remove_table() and the
> C-side cpumask OPP table is leaked.
>
> Clone the cpumask before calling dev_pm_opp_of_cpumask_add_table() so
> that an allocation failure returns cleanly without leaking the OPP
> table.
>
> Fixes: d52c7e868fbc ("rust: opp: Add abstractions for the OPP table")
> Signed-off-by: Bilal Hashim <AeeSec@126.com>
> ---
> Changes in v2:
> - Drop the unreachable Self::from_dev() error rollback hunks in
> Table::from_of() and Table::from_of_cpumask() and keep only the
> CpumaskVar::try_clone() move (thanks to Zhongqiu Han).
> - Update commit message and add Fixes: tag.
> ---
> rust/kernel/opp.rs | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Applied. Thanks.
--
viresh
prev parent reply other threads:[~2026-12-03 10:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 13:17 Bilal Hashim
2026-12-03 10:09 ` Viresh Kumar [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=axE_3fYK40Xsi643@vireshk-B250M-D3H \
--to=viresh.kumar@linaro.org \
--cc=AeeSec@126.com \
--cc=aliceryhl@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=zhongqiu.han@oss.qualcomm.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 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®