[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL_JsqJLyf8-szrAQKWSEpy6gG_j0Cyu9miijOQiO_YSPx_dGQ@mail.gmail.com>
Date: Mon, 16 Jul 2018 08:36:34 -0600
From: Rob Herring <robh+dt@...nel.org>
To: Frank Rowand <frowand.list@...il.com>
Cc: Mark Rutland <mark.rutland@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
devicetree@...r.kernel.org
Subject: Re: [PATCH] of/fdt: avoid undefined behaviour in populate_properties()
On Fri, Jul 6, 2018 at 10:51 AM Frank Rowand <frowand.list@...il.com> wrote:
>
> On 07/06/18 04:37, Mark Rutland wrote:
> > We unflatten a device tree in two passes: the first calculating the size
> > of the unflattened tree, and the second performing the actual
> > unflattening into a suitably-sized buffer.
[...]
> > @@ -187,7 +187,9 @@ static void populate_properties(const void *blob,
> > int cur;
> > bool has_name = false;
> >
> > - pprev = &np->properties;
> > + if (!dryrun)
> > + pprev = &np->properties;
> > +
> > for (cur = fdt_first_property_offset(blob, offset);
> > cur >= 0;
> > cur = fdt_next_property_offset(blob, cur)) {
> >
>
> Please add a one line comment explaining why "if (!dryrun)" so that no one
> decides to remove the test in the future as not needed. Otherwise,
Please re-spin ASAP with the comment if you'd like this in 4.18.
Rob
Powered by blists - more mailing lists