diff options
author | J Freyensee <james_p_freyensee@linux.intel.com> | 2011-05-25 14:45:40 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-07 10:01:19 -0700 |
commit | 1dae42bff57f7a61577ee881265985a660d35c07 (patch) | |
tree | 86bf9823f2da9c28bef6a86e08c652c47e690112 /drivers/misc/pti.c | |
parent | 29021bccea0dc42d7d101004058438a9a4e693b1 (diff) |
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/pti.c')
-rw-r--r-- | 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 be4857358d9..e74e7d26656 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; } |