diff options
author | J Freyensee <james_p_freyensee@linux.intel.com> | 2011-05-25 17:45:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-07 13:01:19 -0400 |
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 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) | |||
476 | else | 476 | else |
477 | pti_tty_data->mc = pti_request_masterchannel(2); | 477 | pti_tty_data->mc = pti_request_masterchannel(2); |
478 | 478 | ||
479 | if (pti_tty_data->mc == NULL) | 479 | if (pti_tty_data->mc == NULL) { |
480 | kfree(pti_tty_data); | ||
480 | return -ENXIO; | 481 | return -ENXIO; |
482 | } | ||
481 | tty->driver_data = pti_tty_data; | 483 | tty->driver_data = pti_tty_data; |
482 | } | 484 | } |
483 | 485 | ||