summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorJ Freyensee <james_p_freyensee@linux.intel.com>2011-05-26 01:45:40 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-07 21:01:19 +0400
commit1dae42bff57f7a61577ee881265985a660d35c07 (patch)
tree86bf9823f2da9c28bef6a86e08c652c47e690112 /drivers/misc
parent29021bccea0dc42d7d101004058438a9a4e693b1 (diff)
downloadlinux-1dae42bff57f7a61577ee881265985a660d35c07.tar.xz
pti: ENXIO error case memory leak PTI fix.
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/pti.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index be4857358d91..e74e7d266569 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;
}