[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <173324705366.2006936.5456851909385472212.robh@kernel.org>
Date: Tue, 3 Dec 2024 11:30:55 -0600
From: "Rob Herring (Arm)" <robh@...nel.org>
To: Herve Codina <herve.codina@...tlin.com>
Cc: Luca Ceresoli <luca.ceresoli@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Saravana Kannan <saravanak@...gle.com>, devicetree@...r.kernel.org,
stable@...r.kernel.org, Stephen Boyd <stephen.boyd@...aro.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] of: Fix error path in of_parse_phandle_with_args_map()
On Mon, 02 Dec 2024 17:58:19 +0100, Herve Codina wrote:
> The current code uses some 'goto put;' to cancel the parsing operation
> and can lead to a return code value of 0 even on error cases.
>
> Indeed, some goto calls are done from a loop without setting the ret
> value explicitly before the goto call and so the ret value can be set to
> 0 due to operation done in previous loop iteration. For instance match
> can be set to 0 in the previous loop iteration (leading to a new
> iteration) but ret can also be set to 0 it the of_property_read_u32()
> call succeed. In that case if no match are found or if an error is
> detected the new iteration, the return value can be wrongly 0.
>
> Avoid those cases setting the ret value explicitly before the goto
> calls.
>
> Fixes: bd6f2fd5a1d5 ("of: Support parsing phandle argument lists through a nexus node")
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Herve Codina <herve.codina@...tlin.com>
> ---
> drivers/of/base.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
Applied, thanks!
Powered by blists - more mailing lists