diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c index be4857358d911dc5540e3e66d2fb2d899bb77477..e74e7d266569c21b7c5c630af9a051f9e7e3a7cc 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; }