Re: [PATCH] of: do not leak console options

2017-10-13 Thread Rob Herring
On Fri, Oct 13, 2017 at 2:48 PM, Geert Uytterhoeven wrote: > On Tue, Oct 3, 2017 at 9:20 AM, Petr Mladek wrote: >> On Tue 2017-09-26 15:25:10, Sergey Senozhatsky wrote: >>> Do not strdup() console options. It seems that the only reason for >>> it to be strdup()-ed was a compilation warning: print

Re: [PATCH] of: do not leak console options

2017-10-13 Thread Geert Uytterhoeven
On Tue, Oct 3, 2017 at 9:20 AM, Petr Mladek wrote: > On Tue 2017-09-26 15:25:10, Sergey Senozhatsky wrote: >> Do not strdup() console options. It seems that the only reason for >> it to be strdup()-ed was a compilation warning: printk, UART and >> console drivers, for some reason, expect char poin

Re: [PATCH] of: do not leak console options

2017-10-12 Thread Rob Herring
On Tue, Sep 26, 2017 at 1:25 AM, Sergey Senozhatsky wrote: > Do not strdup() console options. It seems that the only reason for > it to be strdup()-ed was a compilation warning: printk, UART and > console drivers, for some reason, expect char pointer instead of > const char pointer. So we can just

Re: [PATCH] of: do not leak console options

2017-10-03 Thread Petr Mladek
On Tue 2017-09-26 15:25:10, Sergey Senozhatsky wrote: > Do not strdup() console options. It seems that the only reason for > it to be strdup()-ed was a compilation warning: printk, UART and > console drivers, for some reason, expect char pointer instead of > const char pointer. So we can just pass

Re: [PATCH] of: do not leak console options

2017-09-25 Thread Sergey Senozhatsky
On (09/06/17 10:27), Rob Herring wrote: [..] > > Rob, Grant, > > will this dirty hack work for you? I can respin the patch. > > Yes, as long as you intend to fix things later. Rob, sorry for the delay, I just sent out a simple patch. It contains that 'less-than-pretty' const cast. As of updating

[PATCH] of: do not leak console options

2017-09-25 Thread Sergey Senozhatsky
Do not strdup() console options. It seems that the only reason for it to be strdup()-ed was a compilation warning: printk, UART and console drivers, for some reason, expect char pointer instead of const char pointer. So we can just pass `of_stdout_options', but need to cast it to char pointer. A be

Re: [PATCH] of: do not leak console options

2017-09-07 Thread Sergey Senozhatsky
On (09/06/17 10:27), Rob Herring wrote: [..] > > Yes, as long as you intend to fix things later. Hello Rob, I can try later, but can't guarantee that will succeed :) -ss

Re: [PATCH] of: do not leak console options

2017-09-06 Thread Rob Herring
On Wed, Sep 6, 2017 at 8:29 AM, Sergey Senozhatsky wrote: > Hello, > > On (09/06/17 14:40), Petr Mladek wrote: > [..] >> > I wouldn't know :) let's find that out >> > >> > the patch used to pass `of_stdout_options' in v1 and v2 >> > https://patches.linaro.org/patch/41559/ >> > >> > starting from v

Re: [PATCH] of: do not leak console options

2017-09-06 Thread Sergey Senozhatsky
Hello, On (09/06/17 14:40), Petr Mladek wrote: [..] > > I wouldn't know :) let's find that out > > > > the patch used to pass `of_stdout_options' in v1 and v2 > > https://patches.linaro.org/patch/41559/ > > > > starting from v3 options are kstrdup-ed > > https://patchwork.kernel.org/patch/539876

Re: [PATCH] of: do not leak console options

2017-09-06 Thread Petr Mladek
On Sun 2017-08-27 16:19:10, Sergey Senozhatsky wrote: > Hello, > > (Cc Andrew, Grant) > > On (08/25/17 17:37), Rob Herring wrote: > > On Sat, Aug 26, 2017 at 02:36:47AM +0900, Sergey Senozhatsky wrote: > > > If add_preferred_console() returns error then we must free a > > > copy of `of_stdout_opt

Re: [PATCH] of: do not leak console options

2017-08-27 Thread Sergey Senozhatsky
On (08/27/17 16:19), Sergey Senozhatsky wrote: [..] > int uart_parse_earlycon(char *p, unsigned char *iotype, resource_size_t *addr, > char **options) > { > if (strncmp(p, "mmio,", 5) == 0) { > *iotype = UPIO_MEM; > p += 5; > } else if (

Re: [PATCH] of: do not leak console options

2017-08-27 Thread Sergey Senozhatsky
Hello, (Cc Andrew, Grant) On (08/25/17 17:37), Rob Herring wrote: > On Sat, Aug 26, 2017 at 02:36:47AM +0900, Sergey Senozhatsky wrote: > > If add_preferred_console() returns error then we must free a > > copy of `of_stdout_options' that we create right before the > > console registration. > > >

Re: [PATCH] of: do not leak console options

2017-08-25 Thread Rob Herring
On Sat, Aug 26, 2017 at 02:36:47AM +0900, Sergey Senozhatsky wrote: > If add_preferred_console() returns error then we must free a > copy of `of_stdout_options' that we create right before the > console registration. > > Signed-off-by: Sergey Senozhatsky > --- > drivers/of/base.c | 11 +-

[PATCH] of: do not leak console options

2017-08-25 Thread Sergey Senozhatsky
If add_preferred_console() returns error then we must free a copy of `of_stdout_options' that we create right before the console registration. Signed-off-by: Sergey Senozhatsky --- drivers/of/base.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/of/base.c