Skip to content

Commit

Permalink
serial: ifx6x60: fix memory leak
Browse files Browse the repository at this point in the history
If tty_register_driver() failed then tty_driver is still alive.
Free it with put_tty_driver().

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Vasiliy Kulikov authored and Greg Kroah-Hartman committed Dec 1, 2010
1 parent badb953 commit a4fb0b2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/serial/ifx6x60.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a4fb0b2

Please sign in to comment.