From: Alexander Graf <agraf@suse.de>
To: qemu-devel Developers <qemu-devel@nongnu.org>
Cc: jmforbes@linuxtx.org, qemu-stable@nongnu.org
Subject: [Qemu-devel] [PATCH 1/7] console: Fix segfault on screendump without VGA adapter
Date: Thu, 12 Jan 2012 18:35:25 +0100 [thread overview]
Message-ID: <1326389731-1694-2-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1326389731-1694-1-git-send-email-agraf@suse.de>
When trying to create a screen dump without having any VGA adapter
inside the guest, QEMU segfaults.
This is because it's trying to switch back to the "previous" screen
it was on before dumping the VGA screen. Unfortunately, in my case
there simply is no previous screen so it accesses a NULL pointer.
Fix it by checking if previous_active_console is actually available.
This is 1.0 material.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
console.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/console.c b/console.c
index f6fe441..ed6a653 100644
--- a/console.c
+++ b/console.c
@@ -186,7 +186,9 @@ void vga_hw_screen_dump(const char *filename)
consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
}
- console_select(previous_active_console->index);
+ if (previous_active_console) {
+ console_select(previous_active_console->index);
+ }
}
void vga_hw_text_update(console_ch_t *chardata)
--
1.6.0.2
next prev parent reply other threads:[~2012-01-12 17:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 17:35 [Qemu-devel] [PULL 1.0 0/7] ppc-stable-1.0 patch queue 2012-01-12 Alexander Graf
2012-01-12 17:35 ` Alexander Graf [this message]
2012-01-12 17:35 ` [Qemu-devel] [PATCH 2/7] pseries: Fix array overrun bug in PCI code Alexander Graf
2012-01-12 17:35 ` [Qemu-devel] [PATCH 3/7] kvm-ppc: halt secondary cpus when guest reset Alexander Graf
2012-01-12 17:35 ` [Qemu-devel] [PATCH 4/7] pseries: Emit device tree nodes in reg order Alexander Graf
2012-01-12 17:35 ` [Qemu-devel] [PATCH 5/7] pseries: Add a routine to find a stable "default" vty and use it Alexander Graf
2012-01-12 17:35 ` [Qemu-devel] [PATCH 6/7] pseries: Populate "/chosen/linux, stdout-path" in the FDT Alexander Graf
2012-01-12 17:35 ` [Qemu-devel] [PATCH 7/7] pseries: Don't try to munmap() a malloc()ed TCE table Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1326389731-1694-2-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=jmforbes@linuxtx.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).