mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rob Herring (Arm)" <robh@kernel.org>
To: Herve Codina <herve.codina@bootlin.com>
Cc: Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Saravana Kannan <saravanak@google.com>,
	devicetree@vger.kernel.org, stable@vger.kernel.org,
	Stephen Boyd <stephen.boyd@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of: Fix error path in of_parse_phandle_with_args_map()
Date: Tue, 3 Dec 2024 11:30:55 -0600	[thread overview]
Message-ID: <173324705366.2006936.5456851909385472212.robh@kernel.org> (raw)
In-Reply-To: <20241202165819.158681-1-herve.codina@bootlin.com>


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@vger.kernel.org>
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> ---
>  drivers/of/base.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 

Applied, thanks!


      reply	other threads:[~2024-12-03 17:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 16:58 Herve Codina
2024-12-03 17:30 ` Rob Herring (Arm) [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=173324705366.2006936.5456851909385472212.robh@kernel.org \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=saravanak@google.com \
    --cc=stable@vger.kernel.org \
    --cc=stephen.boyd@linaro.org \
    --cc=thomas.petazzoni@bootlin.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®