]> asedeno.scripts.mit.edu Git - linux.git/commit
tty: tty_io: fix driver refcount imbalance on error path
authorLin Yi <teroincn@163.com>
Fri, 10 May 2019 04:22:57 +0000 (12:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 May 2019 08:09:12 +0000 (10:09 +0200)
commit8c8af41d24c73c6a8b24468bdc53e52b390e4582
treef9c4a80b6ad98d5a86d2c9c39deeb60bafa2773b
parent5e309c6c5ea12515616a4835b7fa2141c8016c94
tty: tty_io: fix driver refcount imbalance on error path

tty_lookup_driver take a reference to the struct tty_driver, but forget
to release it on the error path, lead to a memory leak.
add a tty_driver_kref_put before error return.

Signed-off-by: Lin Yi <teroincn@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c