[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130709083535.GA30227@debian.seek.priv>
Date: Tue, 9 Jul 2013 10:35:35 +0200
From: Gianluca Anzolin <gianluca@...tospazio.it>
To: jslaby@...e.cz
Cc: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org
Subject: [PATCH] Fix refcount leak in tty_port.c
Hello,
In linux 3.10 in the file drivers/tty/tty_port.c the function
tty_port_tty_hangup may leak a tty reference:
struct tty_struct *tty = tty_port_tty_get(port);
if (tty && (!check_clocal || !C_CLOCAL(tty))) {
tty_hangup(tty);
tty_kref_put(tty);
}
If tty != NULL and the second condition is false we never call tty_kref_put and
the reference is leaked.
Fix by nesting two if statements.
Signed-off-by: Gianluca Anzolin <gianluca@...tospazio.it>
View attachment "tty_port.patch" of type "text/x-diff" (466 bytes)
Powered by blists - more mailing lists