aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/console/vgacon.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 74e96cf83b7e..da55ccaf4d55 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -589,12 +589,14 @@ static void vgacon_init(struct vc_data *c, int init)
589 589
590static void vgacon_deinit(struct vc_data *c) 590static void vgacon_deinit(struct vc_data *c)
591{ 591{
592 /* When closing the last console, reset video origin */ 592 /* When closing the active console, reset video origin */
593 if (!--vgacon_uni_pagedir[1]) { 593 if (CON_IS_VISIBLE(c)) {
594 c->vc_visible_origin = vga_vram_base; 594 c->vc_visible_origin = vga_vram_base;
595 vga_set_mem_top(c); 595 vga_set_mem_top(c);
596 con_free_unimap(c);
597 } 596 }
597
598 if (!--vgacon_uni_pagedir[1])
599 con_free_unimap(c);
598 c->vc_uni_pagedir_loc = &c->vc_uni_pagedir; 600 c->vc_uni_pagedir_loc = &c->vc_uni_pagedir;
599 con_set_default_unimap(c); 601 con_set_default_unimap(c);
600} 602}