mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: [PATCH] of: do not leak console options
Date: Tue, 3 Oct 2017 09:20:07 +0200	[thread overview]
Message-ID: <20171003072007.GB9706@pathway.suse.cz> (raw)
In-Reply-To: <20170926062510.4948-1-sergey.senozhatsky@gmail.com>

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 `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 <sergey.senozhatsky@gmail.com>

Of course, it would be better to change add_preferred_console().
But it would trigger many other changes. This alternative
"temporary" change looks safe to me. Feel free to use

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

  reply	other threads:[~2017-10-03  7:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26  6:25 Sergey Senozhatsky
2017-10-03  7:20 ` Petr Mladek [this message]
2017-10-13 19:48   ` Geert Uytterhoeven
2017-10-13 20:44     ` Rob Herring
2017-10-12 17:24 ` Rob Herring
  -- strict thread matches above, loose matches on Subject: below --
2017-08-25 17:36 Sergey Senozhatsky
2017-08-25 22:37 ` Rob Herring
2017-08-27  7:19   ` Sergey Senozhatsky
2017-08-27  8:01     ` Sergey Senozhatsky
2017-09-06 12:40     ` Petr Mladek
2017-09-06 13:29       ` Sergey Senozhatsky
2017-09-06 15:27         ` Rob Herring
2017-09-07  9:57           ` Sergey Senozhatsky
2017-09-26  6:31           ` Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171003072007.GB9706@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome