From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH] tools: ftdgrep: correct the find regions loop in do_fdtgrep
Date: Sun, 12 Jan 2020 20:51:01 +0100 [thread overview]
Message-ID: <20200112205101.669fe9d3@crub> (raw)
In-Reply-To: <20200110085027.1.I4a80e4d2935f07164868f198fe868a0999be777e@changeid>
Hi Patrick,
On Fri, 10 Jan 2020 08:50:31 +0100
Patrick Delaunay patrick.delaunay at st.com wrote:
...
> diff --git a/tools/fdtgrep.c b/tools/fdtgrep.c
> index 8f44f599c1..bcf06b871d 100644
> --- a/tools/fdtgrep.c
> +++ b/tools/fdtgrep.c
> @@ -823,8 +823,10 @@ static int do_fdtgrep(struct display_info *disp, const char *filename)
> }
> if (count <= max_regions)
> break;
> + }
> + if (count > max_regions) {
> free(region);
This change moved free(region) out of the loop. If you do so, then
please also change malloc() in the loop to realloc():
region = realloc(region, count * sizeof(struct fdt_region));
--
Anatolij
next prev parent reply other threads:[~2020-01-12 19:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 7:50 [PATCH] tools: ftdgrep: correct the find regions loop in do_fdtgrep Patrick Delaunay
2020-01-12 19:51 ` Anatolij Gustschin [this message]
2020-01-13 8:24 ` Patrick DELAUNAY
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=20200112205101.669fe9d3@crub \
--to=agust@denx.de \
--cc=u-boot@lists.denx.de \
/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