TTY: call tty_port_destroy in the rest of drivers
[deliverable/linux.git] / drivers / tty / vt / vt.c
index f87d7e8964bf0849c1ab3e3da327e3a14c9b35a2..607636b4734d65305062a97b6e9394b690d18933 100644 (file)
@@ -779,6 +779,7 @@ int vc_allocate(unsigned int currcons)      /* return 0 on success */
                con_set_default_unimap(vc);
            vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
            if (!vc->vc_screenbuf) {
+               tty_port_destroy(&vc->port);
                kfree(vc);
                vc_cons[currcons].d = NULL;
                return -ENOMEM;
@@ -999,8 +1000,10 @@ void vc_deallocate(unsigned int currcons)
                put_pid(vc->vt_pid);
                module_put(vc->vc_sw->owner);
                kfree(vc->vc_screenbuf);
-               if (currcons >= MIN_NR_CONSOLES)
+               if (currcons >= MIN_NR_CONSOLES) {
+                       tty_port_destroy(&vc->port);
                        kfree(vc);
+               }
                vc_cons[currcons].d = NULL;
        }
 }
This page took 0.040287 seconds and 5 git commands to generate.