mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
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>
This commit is contained in:
parent
29021bccea
commit
1dae42bff5
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue