diff options
author | Daeseok Youn | 2014-05-26 12:24:17 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2014-05-26 19:35:24 +0200 |
commit | 0ade4a34fd439d62df46937e8f3e584eb0879579 (patch) | |
tree | 0855f4f315ee6d012633836b8c4404ff05f01383 /drivers/staging/dgap | |
parent | staging: dgap: remove unneeded kfree() for ttys in tty_driver (diff) | |
download | kernel-qcow2-linux-0ade4a34fd439d62df46937e8f3e584eb0879579.tar.gz kernel-qcow2-linux-0ade4a34fd439d62df46937e8f3e584eb0879579.tar.xz kernel-qcow2-linux-0ade4a34fd439d62df46937e8f3e584eb0879579.zip |
staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()
When it failed to allocate for printer_ports, serial_ports
can be freed in dgap_tty_uninit().
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.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 60b7d700b07d..06abb2047443 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -4147,10 +4147,9 @@ static int dgap_tty_register_ports(struct board_t *brd) brd->printer_ports = kcalloc(brd->nasync, sizeof(*brd->printer_ports), GFP_KERNEL); - if (brd->printer_ports == NULL) { - kfree(brd->serial_ports); + if (brd->printer_ports == NULL) return -ENOMEM; - } + for (i = 0; i < brd->nasync; i++) tty_port_init(&brd->printer_ports[i]); |