[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2350c4a3e6c2ed214dd232abc73b2074.sboyd@kernel.org>
Date: Thu, 12 Oct 2023 16:21:54 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Alessandro Carminati (Red Hat) <alessandro.carminati@...il.com>,
linux-clk@...r.kernel.org
Cc: Alessandro Carminati <alessandro.carminati@...il.com>,
linux-kernel@...r.kernel.org,
Michael Turquette <mturquette@...libre.com>,
Philip Daly <pdaly@...hat.com>
Subject: Re: [PATCH v2] clk: Sanitize possible_parent_show to Handle Return Value of of_clk_get_parent_name
Quoting Alessandro Carminati (Red Hat) (2023-09-21 00:32:17)
> From: Alessandro Carminati <alessandro.carminati@...il.com>
>
> In the possible_parent_show function, ensure proper handling of the return
> value from of_clk_get_parent_name to prevent potential issues arising from
> a NULL return.
> The current implementation invokes seq_puts directly on the result of
> of_clk_get_parent_name without verifying the return value, which can lead
> to kernel panic if the function returns NULL.
>
> This patch addresses the concern by introducing a check on the return
> value of of_clk_get_parent_name. If the return value is not NULL, the
> function proceeds to call seq_puts, providing the returned value as
> argument.
> However, if of_clk_get_parent_name returns NULL, the function provides a
> static string as argument, avoiding the panic.
>
> Fixes: 1ccc0ddf046a ("clk: Use seq_puts() in possible_parent_show()")
> Reported-by: Philip Daly <pdaly@...hat.com>
> Signed-off-by: Alessandro Carminati (Red Hat) <alessandro.carminati@...il.com>
> ---
Applied to clk-fixes
Powered by blists - more mailing lists