linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of/fdt: Don't copy garbage after "/" in root node path
@ 2012-10-22  0:32 Benjamin Herrenschmidt
  2012-11-11  3:54 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2012-10-22  0:32 UTC (permalink / raw)
  To: devicetree-discuss; +Cc: linuxppc-dev

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 <benh@kernel.crashing.org>
---
 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'

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] of/fdt: Don't copy garbage after "/" in root node path
  2012-10-22  0:32 [PATCH] of/fdt: Don't copy garbage after "/" in root node path Benjamin Herrenschmidt
@ 2012-11-11  3:54 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2012-11-11  3:54 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: devicetree-discuss, linuxppc-dev

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 <benh@kernel.crashing.org>

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@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-11  3:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22  0:32 [PATCH] of/fdt: Don't copy garbage after "/" in root node path Benjamin Herrenschmidt
2012-11-11  3:54 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).