[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20140526102447.GA13805@devel.8.8.4.4>
Date: Mon, 26 May 2014 19:24:47 +0900
From: Daeseok Youn <daeseok.youn@...il.com>
To: lidza.louina@...il.com, gregkh@...uxfoundation.org
Cc: markh@...pro.net, driverdev-devel@...uxdriverproject.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 4/4] staging: dgap: move tty_port_init() for serial_ports.
If printer_ports which is allocated after serial_ports is failed
to allocate, tty_port_init for serial_ports doesn't need anymore.
So move this after allocating memory for printer_ports.
Signed-off-by: Daeseok Youn <daeseok.youn@...il.com>
---
drivers/staging/dgap/dgap.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 2f47bb7..c8f9e66 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -4153,16 +4153,16 @@ static int dgap_tty_register_ports(struct board_t *brd)
GFP_KERNEL);
if (brd->serial_ports == NULL)
return -ENOMEM;
- for (i = 0; i < brd->nasync; i++)
- tty_port_init(&brd->serial_ports[i]);
brd->printer_ports = kcalloc(brd->nasync, sizeof(*brd->printer_ports),
GFP_KERNEL);
if (brd->printer_ports == NULL)
return -ENOMEM;
- for (i = 0; i < brd->nasync; i++)
+ for (i = 0; i < brd->nasync; i++) {
+ tty_port_init(&brd->serial_ports[i]);
tty_port_init(&brd->printer_ports[i]);
+ }
ch = brd->channels[0];
for (i = 0; i < brd->nasync; i++, ch = brd->channels[i]) {
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists