qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] dumb_display_init() crash
@ 2009-01-20  6:43 Andrew May
  2009-01-20 10:49 ` Stefano Stabellini
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew May @ 2009-01-20  6:43 UTC (permalink / raw)
  To: qemu-devel

This fixes a crash for the 405 boards that don't do a display init.
I would think this is correct but I am not sure if there is more that
needs to be setup. This at least gets me back to the SDL display I use
to see before the re-org.

diff --git a/trunk/vl.c b/trunk/vl.c
index 63d954b..cc58df2 100644
--- a/trunk/vl.c
+++ b/trunk/vl.c
@@ -2778,6 +2778,12 @@ DisplayState *get_displaystate(void)
 static void dumb_display_init(void)
 {
     DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
+
+    if (ds == NULL)
+            return;
+
+    ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4);
+
     register_displaystate(ds);
 }
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] dumb_display_init() crash
  2009-01-20  6:43 [Qemu-devel] [PATCH] dumb_display_init() crash Andrew May
@ 2009-01-20 10:49 ` Stefano Stabellini
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Stabellini @ 2009-01-20 10:49 UTC (permalink / raw)
  To: qemu-devel

Andrew May wrote:

> This fixes a crash for the 405 boards that don't do a display init.
> I would think this is correct but I am not sure if there is more that
> needs to be setup. This at least gets me back to the SDL display I use
> to see before the re-org.

Your fix is correct, I am just going to repost your patch adding
signed-off-lines and changing the return NULL into exit(1) in case the
malloc fails.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-20 10:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-20  6:43 [Qemu-devel] [PATCH] dumb_display_init() crash Andrew May
2009-01-20 10:49 ` Stefano Stabellini

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).