From a4fb0b228e284107b9bdf44769bbdc80efd660e1 Mon Sep 17 00:00:00 2001 From: Vasiliy Kulikov Date: Fri, 19 Nov 2010 21:41:45 +0300 Subject: serial: ifx6x60: fix memory leak If tty_register_driver() failed then tty_driver is still alive. Free it with put_tty_driver(). Signed-off-by: Vasiliy Kulikov Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/serial/ifx6x60.c b/drivers/serial/ifx6x60.c index 3f8d5ee..ab93763 100644 --- a/drivers/serial/ifx6x60.c +++ b/drivers/serial/ifx6x60.c @@ -1384,6 +1384,7 @@ static int __init ifx_spi_init(void) if (result) { pr_err("%s: tty_register_driver failed(%d)", DRVNAME, result); + put_tty_driver(tty_drv); return result; } -- cgit v0.10.2