summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgap
diff options
context:
space:
mode:
authorDaeseok Youn <daeseok.youn@gmail.com>2014-11-06 19:27:11 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-07 09:30:22 -0800
commit429161d164491f430ddbc591f45dc2cd39e0e8a1 (patch)
tree011bc9351a4029a7abe051fd71db7a8267d13edf /drivers/staging/dgap
parentdc3cfcd3f4804c9bf71e3b6152df6eb957856735 (diff)
downloadlinux-429161d164491f430ddbc591f45dc2cd39e0e8a1.tar.gz
linux-429161d164491f430ddbc591f45dc2cd39e0e8a1.tar.bz2
linux-429161d164491f430ddbc591f45dc2cd39e0e8a1.zip
staging: dgap: fix memory leak caused by double allocation of tty_structs
The tty_struct of serial_driver and print_driver were getting allocated twice. One is allocated in tty_alloc_driver(), the other is in dgap_tty_register(). So remove these in dgap_tty_register(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgap')
-rw-r--r--drivers/staging/dgap/dgap.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 6418cc5687de..688aaa43e6dc 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -5254,14 +5254,6 @@ static int dgap_tty_register(struct board_t *brd)
brd->serial_driver->init_termios = dgap_default_termios;
brd->serial_driver->driver_name = DRVSTR;
- /* The kernel wants space to store pointers to tty_structs */
- brd->serial_driver->ttys =
- kzalloc(MAXPORTS * sizeof(struct tty_struct *), GFP_KERNEL);
- if (!brd->serial_driver->ttys) {
- rc = -ENOMEM;
- goto free_serial_drv;
- }
-
/*
* Entry points for driver. Called by the kernel from
* tty_io.c and n_tty.c.
@@ -5293,14 +5285,6 @@ static int dgap_tty_register(struct board_t *brd)
brd->print_driver->init_termios = dgap_default_termios;
brd->print_driver->driver_name = DRVSTR;
- /* The kernel wants space to store pointers to tty_structs */
- brd->print_driver->ttys =
- kzalloc(MAXPORTS * sizeof(struct tty_struct *), GFP_KERNEL);
- if (!brd->print_driver->ttys) {
- rc = -ENOMEM;
- goto free_print_drv;
- }
-
/*
* Entry points for driver. Called by the kernel from
* tty_io.c and n_tty.c.