public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] tty: save newly allocated buffer in tty_free_termios()
@ 2012-07-20 13:32 Dan Carpenter
  2012-07-20 14:00 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-07-20 13:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Cox; +Cc: linux-kernel, kernel-janitors

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index be18d60..58a1bdd 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -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;
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-20 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-20 13:32 [patch] tty: save newly allocated buffer in tty_free_termios() Dan Carpenter
2012-07-20 14:00 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox