From: Chen Gang <gang.chen@asianux.com>
To: alan@linux.intel.com
Cc: linux-serial@vger.kernel.org
Subject: [PATCH] drivers/tty/serial: avoid double free after call ioc4_serial_remove_one
Date: Wed, 26 Dec 2012 18:06:39 +0800 [thread overview]
Message-ID: <50DACC2F.5080302@asianux.com> (raw)
before goto out5, soft, control, serial are all assigned to idd
after finish call ioc4_serial_remove_one, all resources are released
we need return instead of go on, or double free
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
drivers/tty/serial/ioc4_serial.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
index 3e7da10..c4e30b8 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -2883,6 +2883,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
/* error exits that give back resources */
out5:
ioc4_serial_remove_one(idd);
+ return ret;
out4:
kfree(soft);
out3:
--
1.7.10.4
next reply other threads:[~2012-12-26 10:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-26 10:06 Chen Gang [this message]
2013-01-10 8:03 ` [PATCH] drivers/tty/serial: avoid double free after call ioc4_serial_remove_one Chen Gang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50DACC2F.5080302@asianux.com \
--to=gang.chen@asianux.com \
--cc=alan@linux.intel.com \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.