[lkml]   [2017]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] of: do not leak console options
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 pass `of_stdout_options', but
> need to cast it to char pointer. A better fix would be to change
> printk, console drivers and UART to accept const char `options';
> but that will take time - there are lots of drivers to update.
> The patch also fixes a possible memory leak: add_preferred_console()
> can fail, but we don't kfree() options.
> Signed-off-by: Sergey Senozhatsky <>
> ---
> drivers/of/base.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)



 \ /
  Last update: 2017-10-12 19:25    [W:0.068 / U:2.184 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site