diff options
Diffstat (limited to 'c/src/lib/libc/termios.c')
-rw-r--r-- | c/src/lib/libc/termios.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/c/src/lib/libc/termios.c b/c/src/lib/libc/termios.c index 4059b544bd..e7fcf8ee30 100644 --- a/c/src/lib/libc/termios.c +++ b/c/src/lib/libc/termios.c @@ -206,7 +206,7 @@ rtems_termios_open ( /* * Create a new device */ - tty = malloc (sizeof (struct rtems_termios_tty)); + tty = calloc (1, sizeof (struct rtems_termios_tty)); if (tty == NULL) { rtems_semaphore_release (ttyMutex); return RTEMS_NO_MEMORY; @@ -219,7 +219,6 @@ rtems_termios_open ( tty->minor = minor; tty->major = major; - tty->refcount = 0; /* * Set up mutex semaphores @@ -250,6 +249,8 @@ rtems_termios_open ( rtems_fatal_error_occurred (sc); tty->rawOutBufHead = 0; tty->rawOutBufTail = 0; + tty->refcount = 0; + tty->rawOutBufState = rob_idle; /* * Set callbacks |