termios: Fix use of uninitialized variable

Update #2840.
This commit is contained in:
Sebastian Huber
2018-02-22 15:34:48 +01:00
parent 40c623a883
commit 5618997dfd

View File

@@ -372,8 +372,6 @@ rtems_termios_open_tty(
const rtems_termios_callbacks *callbacks const rtems_termios_callbacks *callbacks
) )
{ {
rtems_status_code sc;
if (tty == NULL) { if (tty == NULL) {
static char c = 'a'; static char c = 'a';
rtems_termios_device_context *ctx; rtems_termios_device_context *ctx;
@@ -490,6 +488,8 @@ rtems_termios_open_tty(
* Create I/O tasks * Create I/O tasks
*/ */
if (tty->handler.mode == TERMIOS_TASK_DRIVEN) { if (tty->handler.mode == TERMIOS_TASK_DRIVEN) {
rtems_status_code sc;
sc = rtems_task_create ( sc = rtems_task_create (
rtems_build_name ('T', 'x', 'T', c), rtems_build_name ('T', 'x', 'T', c),
TERMIOS_TXTASK_PRIO, TERMIOS_TXTASK_PRIO,
@@ -516,8 +516,6 @@ rtems_termios_open_tty(
(tty->handler.mode == TERMIOS_TASK_DRIVEN)){ (tty->handler.mode == TERMIOS_TASK_DRIVEN)){
rtems_binary_semaphore_init (&tty->rawInBuf.Semaphore, rtems_binary_semaphore_init (&tty->rawInBuf.Semaphore,
"termios raw input"); "termios raw input");
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
} }
/* /*
@@ -573,6 +571,8 @@ rtems_termios_open_tty(
* start I/O tasks, if needed * start I/O tasks, if needed
*/ */
if (tty->handler.mode == TERMIOS_TASK_DRIVEN) { if (tty->handler.mode == TERMIOS_TASK_DRIVEN) {
rtems_status_code sc;
sc = rtems_task_start( sc = rtems_task_start(
tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty); tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)