mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 3/4] staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()
@ 2014-05-26 10:24 Daeseok Youn
  0 siblings, 0 replies; only message in thread
From: Daeseok Youn @ 2014-05-26 10:24 UTC (permalink / raw)
  To: lidza.louina, gregkh; +Cc: markh, driverdev-devel, devel, linux-kernel

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>
---
 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-05-26 10:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-26 10:24 [PATCH 3/4] staging: dgap: remove unneeded kfree() in dgap_tty_register_ports() Daeseok Youn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®