From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: [PATCH] of/fdt: Don't copy garbage after "/" in root node path Date: Sat, 10 Nov 2012 21:54:37 -0600 Message-ID: <509F217D.8020901@gmail.com> References: <1350865950.2476.145.camel@pasglop> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1350865950.2476.145.camel@pasglop> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Benjamin Herrenschmidt Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linuxppc-dev List-Id: devicetree@vger.kernel.org On 10/21/2012 07:32 PM, Benjamin Herrenschmidt wrote: > The root node path must be internally converted to "/", or various > pieces of code looking for it that way will fail. The code to do > that however had a bug where we might incorrectly append pieces > of the original path from the fdt to the "/". > > We should probably add a proper dedicated accessor for the root node > but in the meantime this patch should fix it. > > Signed-off-by: Benjamin Herrenschmidt Applied. Thanks. Rob > --- > drivers/of/fdt.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index 91a375f..c2b08dc 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -186,6 +186,7 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob, > */ > fpsize = 1; > allocl = 2; > + l = 0; > } else { > /* account for '/' and path size minus terminal 0 > * already in 'l' > > > _______________________________________________ > devicetree-discuss mailing list > devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org > https://lists.ozlabs.org/listinfo/devicetree-discuss >