lkml.org 
[lkml]   [2020]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/3] printk: Fix preferred console selection with multiple matches
On (20/02/13 09:39), Petr Mladek wrote:
> > > struct console_cmdline *c;
> > > int i;
> > > @@ -2131,6 +2131,8 @@ static int __add_preferred_console(char *name, int idx, char *options,
> > > if (strcmp(c->name, name) == 0 && c->index == idx) {
> > > if (!brl_options)
> > > preferred_console = i;
> > > + if (user_specified)
> > > + c->user_specified = true;
> > > return 0;
> > > }
> > > }

[..]

> > A silly question:
> >
> > Can the same console first be added by
> > console_setup()->__add_preferred_console(true)
> > and then by
> > add_preferred_console()->__add_preferred_console(false)
>
> I guess that this might happen. It should be safe because
> user_specified flag is set only to true when found again,
> see:
>
> if (user_specified)
> c->user_specified = true;

Yikes, I didn't see the if-condition. Yes, you are right.

-ss

\
 
 \ /
  Last update: 2020-02-13 10:09    [W:0.027 / U:12.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site