[PATCH 3/4] staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()
From: Daeseok Youn
Date: Mon May 26 2014 - 06:25:08 EST
When it failed to allocate for printer_ports, serial_ports
can be freed in dgap_tty_uninit().
Signed-off-by: Daeseok Youn <daeseok.youn@xxxxxxxxx>
---
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 db24f70..2f47bb7 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -4158,10 +4158,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]);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/