Skip to content

Commit

Permalink
pti: ENXIO error case memory leak PTI fix.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
J Freyensee authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent 29021bc commit 1dae42b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/misc/pti.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1dae42b

Please sign in to comment.