lkml.org 
[lkml]   [2012]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] 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.

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;
}

\
 
 \ /
  Last update: 2012-07-20 17:41    [W:0.023 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site