devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of/fdt: fix allocation size for device node path
@ 2015-04-14  4:36 Ricky Liang
       [not found] ` <1428986165-6250-1-git-send-email-jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Ricky Liang @ 2015-04-14  4:36 UTC (permalink / raw)
  To: Grant Likely
  Cc: Ricky Liang, Rob Herring, open list:OPEN FIRMWARE AND...,
	open list

The allocation size of device node path is off by one which drops the
'\0' terminator.

Signed-off-by: Ricky Liang <jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 3a896c9..98a9e6e 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -172,7 +172,7 @@ static void * unflatten_dt_node(void *blob,
 	if (!pathp)
 		return mem;
 
-	allocl = l++;
+	allocl = ++l;
 
 	/* version 0x10 has a more compact unit name here instead of the full
 	 * path. we accumulate the full path size using "fpsize", we'll rebuild
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] of/fdt: fix allocation size for device node path
       [not found] ` <1428986165-6250-1-git-send-email-jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2015-04-15 12:15   ` Grant Likely
  2015-04-15 12:37     ` Ricky Liang
       [not found]     ` <20150415121515.8E1FAC40A0B-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Grant Likely @ 2015-04-15 12:15 UTC (permalink / raw)
  Cc: Ricky Liang, Rob Herring, open list:OPEN FIRMWARE AND...,
	open list

On Tue, 14 Apr 2015 12:36:05 +0800
, Ricky Liang <jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
 wrote:
> The allocation size of device node path is off by one which drops the
> '\0' terminator.
> 
> Signed-off-by: Ricky Liang <jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

This looks like something that should be backported to stable. Do you agree?

g.

> ---
>  drivers/of/fdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 3a896c9..98a9e6e 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -172,7 +172,7 @@ static void * unflatten_dt_node(void *blob,
>  	if (!pathp)
>  		return mem;
>  
> -	allocl = l++;
> +	allocl = ++l;
>  
>  	/* version 0x10 has a more compact unit name here instead of the full
>  	 * path. we accumulate the full path size using "fpsize", we'll rebuild
> -- 
> 2.1.2
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] of/fdt: fix allocation size for device node path
  2015-04-15 12:15   ` Grant Likely
@ 2015-04-15 12:37     ` Ricky Liang
       [not found]     ` <20150415121515.8E1FAC40A0B-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Ricky Liang @ 2015-04-15 12:37 UTC (permalink / raw)
  To: Grant Likely; +Cc: Rob Herring, open list:OPEN FIRMWARE AND..., open list

[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]

Yes I agree. I'm not familiar with the kernel patch backport
process. Should I be the one doing the backport?

On Wed, Apr 15, 2015 at 8:15 PM Grant Likely <grant.likely@linaro.org>
wrote:

> On Tue, 14 Apr 2015 12:36:05 +0800
> , Ricky Liang <jcliang@chromium.org>
>  wrote:
> > The allocation size of device node path is off by one which drops the
> > '\0' terminator.
> >
> > Signed-off-by: Ricky Liang <jcliang@chromium.org>
>
> This looks like something that should be backported to stable. Do you
> agree?
>
> g.
>
> > ---
> >  drivers/of/fdt.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> > index 3a896c9..98a9e6e 100644
> > --- a/drivers/of/fdt.c
> > +++ b/drivers/of/fdt.c
> > @@ -172,7 +172,7 @@ static void * unflatten_dt_node(void *blob,
> >       if (!pathp)
> >               return mem;
> >
> > -     allocl = l++;
> > +     allocl = ++l;
> >
> >       /* version 0x10 has a more compact unit name here instead of the
> full
> >        * path. we accumulate the full path size using "fpsize", we'll
> rebuild
> > --
> > 2.1.2
> >
>
>

[-- Attachment #2: Type: text/html, Size: 1700 bytes --]

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

* Re: [PATCH] of/fdt: fix allocation size for device node path
       [not found]     ` <20150415121515.8E1FAC40A0B-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
@ 2015-04-15 13:00       ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2015-04-15 13:00 UTC (permalink / raw)
  To: Grant Likely
  Cc: Ricky Liang, Rob Herring, open list:OPEN FIRMWARE AND...,
	open list

On Wed, Apr 15, 2015 at 7:15 AM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Tue, 14 Apr 2015 12:36:05 +0800
> , Ricky Liang <jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
>  wrote:
>> The allocation size of device node path is off by one which drops the
>> '\0' terminator.
>>
>> Signed-off-by: Ricky Liang <jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
>
> This looks like something that should be backported to stable. Do you agree?

I've applied, but didn't tag it. I'll send it for stable once it is in
Linus' tree.

BTW, it only affects old dtb versions less than 0x10 because allocl is
overwritten in the 'if' statement just below here.

Rob

>
> g.
>
>> ---
>>  drivers/of/fdt.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>> index 3a896c9..98a9e6e 100644
>> --- a/drivers/of/fdt.c
>> +++ b/drivers/of/fdt.c
>> @@ -172,7 +172,7 @@ static void * unflatten_dt_node(void *blob,
>>       if (!pathp)
>>               return mem;
>>
>> -     allocl = l++;
>> +     allocl = ++l;
>>
>>       /* version 0x10 has a more compact unit name here instead of the full
>>        * path. we accumulate the full path size using "fpsize", we'll rebuild
>> --
>> 2.1.2
>>
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-04-15 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14  4:36 [PATCH] of/fdt: fix allocation size for device node path Ricky Liang
     [not found] ` <1428986165-6250-1-git-send-email-jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2015-04-15 12:15   ` Grant Likely
2015-04-15 12:37     ` Ricky Liang
     [not found]     ` <20150415121515.8E1FAC40A0B-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2015-04-15 13:00       ` 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).