[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ-ks9=QNo670XQ11TsDMorgsRz4g1VhX_9qVUf8Za3Q44Jh7g@mail.gmail.com>
Date: Wed, 29 Oct 2025 10:24:22 -0400
From: Tamir Duberstein <tamird@...nel.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>, Stephen Boyd <sboyd@...nel.org>, 
	Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, 
	Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
	Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>, 
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, 
	Danilo Krummrich <dakr@...nel.org>, linux-pm@...r.kernel.org, rust-for-linux@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] rust: opp: simplify callers of `to_c_str_array`
On Thu, Oct 23, 2025 at 11:23 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> On 23-10-25, 09:59, Tamir Duberstein wrote:
> > Use `Option` combinators to make this a bit less noisy.
> >
> > Wrap the `dev_pm_opp_set_config` operation in a closure and use type
> > ascription to leverage the compiler to check for use after free.
> >
> > Signed-off-by: Tamir Duberstein <tamird@...nel.org>
> > ---
> > Note: this diff is much smaller with whitespace suppressed (`-w`).
> >
> > An alternative approach to compiler checking for UAF that doesn't change
> > indentation is to add `drop((self, clk_names, regulator_names))` after
> > `let ret = ...;` but that felt more prone to becoming out of date if
> > more owned data needed to be added to the function scope.
> > ---
> > Changes in v2:
> > - Avoid use after free; add compiler checking. (Thanks Viresh!)
> > - Link to v1: https://patch.msgid.link/20251020-opp-simpler-code-v1-1-04f7f447712f@kernel.org
> > ---
> >  rust/kernel/opp.rs | 112 +++++++++++++++++++++++++++--------------------------
> >  1 file changed, 58 insertions(+), 54 deletions(-)
>
> Thanks, tested this and it works.
>
> Lets see if someone has any more inputs, otherwise I can apply it.
Thanks for testing! Doesn't look like anyone has opinions. Good to go?
Powered by blists - more mailing lists
 
