Skip to content

Commit bba18a1

Browse files
andy-shevpmladek
authored andcommitted
console: Propagate error code from console ->setup()
Since console ->setup() hook returns meaningful error codes, propagate it to the caller of try_enable_new_console(). Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9f02842 commit bba18a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/printk/printk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,7 +2668,7 @@ early_param("keep_bootcon", keep_bootcon_setup);
26682668
static int try_enable_new_console(struct console *newcon, bool user_specified)
26692669
{
26702670
struct console_cmdline *c;
2671-
int i;
2671+
int i, err;
26722672

26732673
for (i = 0, c = console_cmdline;
26742674
i < MAX_CMDLINECONSOLES && c->name[0];
@@ -2691,8 +2691,8 @@ static int try_enable_new_console(struct console *newcon, bool user_specified)
26912691
return 0;
26922692

26932693
if (newcon->setup &&
2694-
newcon->setup(newcon, c->options) != 0)
2695-
return -EIO;
2694+
(err = newcon->setup(newcon, c->options)) != 0)
2695+
return err;
26962696
}
26972697
newcon->flags |= CON_ENABLED;
26982698
if (i == preferred_console) {

0 commit comments

Comments
 (0)