|
@@ -779,7 +779,6 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
|
|
con_set_default_unimap(vc);
|
|
con_set_default_unimap(vc);
|
|
vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
|
|
vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
|
|
if (!vc->vc_screenbuf) {
|
|
if (!vc->vc_screenbuf) {
|
|
- tty_port_destroy(&vc->port);
|
|
|
|
kfree(vc);
|
|
kfree(vc);
|
|
vc_cons[currcons].d = NULL;
|
|
vc_cons[currcons].d = NULL;
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
@@ -986,26 +985,25 @@ static int vt_resize(struct tty_struct *tty, struct winsize *ws)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-void vc_deallocate(unsigned int currcons)
|
|
|
|
|
|
+struct vc_data *vc_deallocate(unsigned int currcons)
|
|
{
|
|
{
|
|
|
|
+ struct vc_data *vc = NULL;
|
|
|
|
+
|
|
WARN_CONSOLE_UNLOCKED();
|
|
WARN_CONSOLE_UNLOCKED();
|
|
|
|
|
|
if (vc_cons_allocated(currcons)) {
|
|
if (vc_cons_allocated(currcons)) {
|
|
- struct vc_data *vc = vc_cons[currcons].d;
|
|
|
|
- struct vt_notifier_param param = { .vc = vc };
|
|
|
|
|
|
+ struct vt_notifier_param param;
|
|
|
|
|
|
|
|
+ param.vc = vc = vc_cons[currcons].d;
|
|
atomic_notifier_call_chain(&vt_notifier_list, VT_DEALLOCATE, ¶m);
|
|
atomic_notifier_call_chain(&vt_notifier_list, VT_DEALLOCATE, ¶m);
|
|
vcs_remove_sysfs(currcons);
|
|
vcs_remove_sysfs(currcons);
|
|
vc->vc_sw->con_deinit(vc);
|
|
vc->vc_sw->con_deinit(vc);
|
|
put_pid(vc->vt_pid);
|
|
put_pid(vc->vt_pid);
|
|
module_put(vc->vc_sw->owner);
|
|
module_put(vc->vc_sw->owner);
|
|
kfree(vc->vc_screenbuf);
|
|
kfree(vc->vc_screenbuf);
|
|
- if (currcons >= MIN_NR_CONSOLES) {
|
|
|
|
- tty_port_destroy(&vc->port);
|
|
|
|
- kfree(vc);
|
|
|
|
- }
|
|
|
|
vc_cons[currcons].d = NULL;
|
|
vc_cons[currcons].d = NULL;
|
|
}
|
|
}
|
|
|
|
+ return vc;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|