Skip to contentSkip to conversation

check for active_console before using it

PATCH Applied Gerd Hoffmann 2 participants 2 messages May 20, 2010 – Jun 1, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 check for active_console before using it

Other vga_hw_* functions do the same.
Fixes a segmentation fault. Trigger: boot with -nodefaults, then connect via vnc.

---
 console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
console.c +1 -1
index 7070b1b..4c42b28 100644
@@ -167,7 +167,7 @@ void vga_hw_update(void)
 
 void vga_hw_invalidate(void)
 {
-    if (active_console->hw_invalidate)
+    if (active_console && active_console->hw_invalidate)
         active_console->hw_invalidate(active_console->hw);
 }
 
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 6 lines · Gerd Hoffmann

Other vga_hw_* functions do the same.
Fixes a segmentation fault. Trigger: boot with -nodefaults, then connect via vnc.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 18 lines
---
  console.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
console.c +1 -1
index 7070b1b..4c42b28 100644
@@ -167,7 +167,7 @@ void vga_hw_update(void)
 
  void vga_hw_invalidate(void)
  {
-    if (active_console->hw_invalidate)
+    if (active_console&&  active_console->hw_invalidate)
          active_console->hw_invalidate(active_console->hw);
  }