pti: ENXIO error case memory leak PTI fix.
authorJ Freyensee <james_p_freyensee@linux.intel.com>
Wed, 25 May 2011 21:45:40 +0000 (14:45 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 7 Jun 2011 17:01:19 +0000 (10:01 -0700)
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

index be4857358d911dc5540e3e66d2fb2d899bb77477..e74e7d266569c21b7c5c630af9a051f9e7e3a7cc 100644 (file)
@@ -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;
        }
 
This page took 0.030447 seconds and 5 git commands to generate.