Skip to content

Commit

Permalink
serial: samsung: Fix unintended usage of uart port 0 as console
Browse files Browse the repository at this point in the history
In s3c24xx_serial_console_setup function, if the uart port that is
being setup as a console has not been initialized, an error can be
returned instead of using uart port 0 as the default console port.
The uart port that was intended to be used as a console could be
initialized at a later point during boot and then registered as a
console. This will avoid using uart port 0 as a unintended console
port.

Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
  • Loading branch information
Thomas Abraham authored and Kukjin Kim committed Jul 7, 2011
1 parent 2c53b43 commit ee430f1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/tty/serial/samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,10 +1416,8 @@ s3c24xx_serial_console_setup(struct console *co, char *options)

/* is the port configured? */

if (port->mapbase == 0x0) {
co->index = 0;
port = &s3c24xx_serial_ports[co->index].port;
}
if (port->mapbase == 0x0)
return -ENODEV;

cons_uart = port;

Expand Down

0 comments on commit ee430f1

Please sign in to comment.