From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: J Freyensee <james_p_freyensee@linux.intel.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 6/9] pti: ENXIO error case memory leak PTI fix.
Date: Tue, 28 Jun 2011 09:02:03 -0700 [thread overview]
Message-ID: <1309276926-1327-6-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1309276926-1327-1-git-send-email-gregkh@suse.de>
From: J Freyensee <james_p_freyensee@linux.intel.com>
This patch fixes a memory leak that can occur in the error case
ENXIO is returned in the pti_tty_install() routine.
Signed-off-by: J Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/misc/pti.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index be48573..e74e7d2 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -476,8 +476,10 @@ static int pti_tty_install(struct tty_driver *driver, struct tty_struct *tty)
else
pti_tty_data->mc = pti_request_masterchannel(2);
- if (pti_tty_data->mc == NULL)
+ if (pti_tty_data->mc == NULL) {
+ kfree(pti_tty_data);
return -ENXIO;
+ }
tty->driver_data = pti_tty_data;
}
--
1.7.5.4
next prev parent reply other threads:[~2011-06-28 16:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-28 15:39 [GIT PATCH] driver core fixes for 3.0 Greg KH
2011-06-28 16:01 ` [PATCH 1/9] firmware: fix GOOGLE_SMI kconfig dependency warning Greg Kroah-Hartman
2011-06-28 16:01 ` [PATCH 2/9] st_kim: Handle case of no device found for ID 0 Greg Kroah-Hartman
2011-06-28 16:02 ` [PATCH 3/9] drivers/base/platform.c: don't mark platform_device_register_resndata() as __init_or_module Greg Kroah-Hartman
2011-06-28 16:02 ` [PATCH 4/9] drivers:misc: ti-st: fix skipping of change remote baud Greg Kroah-Hartman
2011-06-28 16:02 ` [PATCH 5/9] pti: double-free security PTI fix Greg Kroah-Hartman
2011-06-28 16:02 ` Greg Kroah-Hartman [this message]
2011-06-28 16:02 ` [PATCH 7/9] pti: PTI semantics fix in pti_tty_cleanup Greg Kroah-Hartman
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=1309276926-1327-6-git-send-email-gregkh@suse.de \
--to=gregkh@suse.de \
--cc=james_p_freyensee@linux.intel.com \
--cc=linux-kernel@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 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®