Skip to contentSkip to conversation

tty: save newly allocated buffer in tty_free_termios()

PATCH In review Dan Carpenter 2 participants 2 messages Jul 20, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: save newly allocated buffer in tty_free_termios()

We're trying to save the termios state and we need to allocate a buffer to do it. Smatch complains that the buffer is leaked at the end of the function.

drivers/tty/tty_io.c +1 -0
index be18d60..58a1bdd 100644
@@ -1450,6 +1450,7 @@ void tty_free_termios(struct tty_struct *tty)
 			pr_warn("tty: no memory to save termios state.\n");
 			return;
 		}
+		tty->driver->termios[idx] = tp;
 	}
 	*tp = tty->termios;
 }