Re: [PATCH] of: Deep-copy names of platform devices

2014-08-15 Thread Grant Likely
On Fri, Aug 15, 2014 at 11:52 AM, Grant Likely wrote: > On Fri, Aug 15, 2014 at 11:45 AM, Grant Likely > wrote: >> On Tue, 12 Aug 2014 18:46:36 -0700, Stephen Boyd >> wrote: >>> On 08/12/14 17:57, Stepan Moskovchenko wrote: >>> > diff --git a/drivers/of/device.c b/drivers/of/device.c >>> >

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-15 Thread Grant Likely
On Fri, Aug 15, 2014 at 11:45 AM, Grant Likely wrote: > On Tue, 12 Aug 2014 18:46:36 -0700, Stephen Boyd wrote: >> On 08/12/14 17:57, Stepan Moskovchenko wrote: >> > diff --git a/drivers/of/device.c b/drivers/of/device.c >> > index f685e55..3e116f6 100644 >> > --- a/drivers/of/device.c >> > +++

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-15 Thread Grant Likely
On Tue, 12 Aug 2014 18:46:36 -0700, Stephen Boyd wrote: > On 08/12/14 17:57, Stepan Moskovchenko wrote: > > diff --git a/drivers/of/device.c b/drivers/of/device.c > > index f685e55..3e116f6 100644 > > --- a/drivers/of/device.c > > +++ b/drivers/of/device.c > > @@ -54,7 +54,7 @@ int

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-15 Thread Grant Likely
On Tue, 12 Aug 2014 18:46:36 -0700, Stephen Boyd sb...@codeaurora.org wrote: On 08/12/14 17:57, Stepan Moskovchenko wrote: diff --git a/drivers/of/device.c b/drivers/of/device.c index f685e55..3e116f6 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -54,7 +54,7 @@ int

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-15 Thread Grant Likely
On Fri, Aug 15, 2014 at 11:45 AM, Grant Likely grant.lik...@linaro.org wrote: On Tue, 12 Aug 2014 18:46:36 -0700, Stephen Boyd sb...@codeaurora.org wrote: On 08/12/14 17:57, Stepan Moskovchenko wrote: diff --git a/drivers/of/device.c b/drivers/of/device.c index f685e55..3e116f6 100644 ---

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-15 Thread Grant Likely
On Fri, Aug 15, 2014 at 11:52 AM, Grant Likely grant.lik...@linaro.org wrote: On Fri, Aug 15, 2014 at 11:45 AM, Grant Likely grant.lik...@linaro.org wrote: On Tue, 12 Aug 2014 18:46:36 -0700, Stephen Boyd sb...@codeaurora.org wrote: On 08/12/14 17:57, Stepan Moskovchenko wrote: diff --git

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-12 Thread Stephen Boyd
On 08/12/14 17:57, Stepan Moskovchenko wrote: > diff --git a/drivers/of/device.c b/drivers/of/device.c > index f685e55..3e116f6 100644 > --- a/drivers/of/device.c > +++ b/drivers/of/device.c > @@ -54,7 +54,7 @@ int of_device_add(struct platform_device *ofdev) > > /* name and id have to be

[PATCH] of: Deep-copy names of platform devices

2014-08-12 Thread Stepan Moskovchenko
When we parse the device tree and allocate platform devices, the 'name' of the newly-created platform_device is set to point to the 'name' field of the 'struct device' embedded within the platform_device. This is dangerous, because the name of the 'struct device' is dynamically allocated. Drivers

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-12 Thread Stepan Moskovchenko
On 8/12/2014 9:12 AM, Kumar Gala wrote: On Aug 11, 2014, at 9:42 PM, Stepan Moskovchenko wrote: When we parse the device tree and allocate platform devices, the 'name' of the newly-created platform_device is set to point to the 'name' field of the 'struct device' embedded within the

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-12 Thread Kumar Gala
On Aug 11, 2014, at 9:42 PM, Stepan Moskovchenko wrote: > When we parse the device tree and allocate platform > devices, the 'name' of the newly-created platform_device > is set to point to the 'name' field of the 'struct device' > embedded within the platform_device. This is dangerous, >

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-12 Thread Kumar Gala
On Aug 11, 2014, at 9:42 PM, Stepan Moskovchenko step...@codeaurora.org wrote: When we parse the device tree and allocate platform devices, the 'name' of the newly-created platform_device is set to point to the 'name' field of the 'struct device' embedded within the platform_device. This is

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-12 Thread Stepan Moskovchenko
On 8/12/2014 9:12 AM, Kumar Gala wrote: On Aug 11, 2014, at 9:42 PM, Stepan Moskovchenko step...@codeaurora.org wrote: When we parse the device tree and allocate platform devices, the 'name' of the newly-created platform_device is set to point to the 'name' field of the 'struct device'

[PATCH] of: Deep-copy names of platform devices

2014-08-12 Thread Stepan Moskovchenko
When we parse the device tree and allocate platform devices, the 'name' of the newly-created platform_device is set to point to the 'name' field of the 'struct device' embedded within the platform_device. This is dangerous, because the name of the 'struct device' is dynamically allocated. Drivers

Re: [PATCH] of: Deep-copy names of platform devices

2014-08-12 Thread Stephen Boyd
On 08/12/14 17:57, Stepan Moskovchenko wrote: diff --git a/drivers/of/device.c b/drivers/of/device.c index f685e55..3e116f6 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -54,7 +54,7 @@ int of_device_add(struct platform_device *ofdev) /* name and id have to be set so

[PATCH] of: Deep-copy names of platform devices

2014-08-11 Thread Stepan Moskovchenko
When we parse the device tree and allocate platform devices, the 'name' of the newly-created platform_device is set to point to the 'name' field of the 'struct device' embedded within the platform_device. This is dangerous, because the name of the 'struct device' is dynamically allocated. Drivers

[PATCH] of: Deep-copy names of platform devices

2014-08-11 Thread Stepan Moskovchenko
When we parse the device tree and allocate platform devices, the 'name' of the newly-created platform_device is set to point to the 'name' field of the 'struct device' embedded within the platform_device. This is dangerous, because the name of the 'struct device' is dynamically allocated. Drivers