]> git.proxmox.com Git - qemu.git/blobdiff - console.c
Add property to tag
[qemu.git] / console.c
index 68ac970654fe9ec1df5b906d252cd06cfa710bc9..3f2794e16db4e94e8fc9017041b33c286f383632 100644 (file)
--- a/console.c
+++ b/console.c
@@ -1246,9 +1246,6 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
     if (nb_consoles >= MAX_CONSOLES)
         return NULL;
     s = qemu_mallocz(sizeof(TextConsole));
-    if (!s) {
-        return NULL;
-    }
     if (!active_console || ((active_console->console_type != GRAPHIC_CONSOLE) &&
         (console_type == GRAPHIC_CONSOLE))) {
         active_console = s;
@@ -1280,8 +1277,6 @@ DisplayState *graphic_console_init(vga_hw_update_ptr update,
     DisplayState *ds;
 
     ds = (DisplayState *) qemu_mallocz(sizeof(DisplayState));
-    if (ds == NULL)
-        return NULL;
     ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4);
 
     s = new_console(ds, GRAPHIC_CONSOLE);
@@ -1402,8 +1397,6 @@ CharDriverState *text_console_init(const char *p)
     CharDriverState *chr;
 
     chr = qemu_mallocz(sizeof(CharDriverState));
-    if (!chr)
-        return NULL;
 
     if (n_text_consoles == 128) {
         fprintf(stderr, "Too many text consoles\n");
@@ -1562,10 +1555,6 @@ PixelFormat qemu_default_pixelformat(int bpp)
 DisplaySurface* qemu_create_displaysurface(int width, int height, int bpp, int linesize)
 {
     DisplaySurface *surface = (DisplaySurface*) qemu_mallocz(sizeof(DisplaySurface));
-    if (surface == NULL) {
-        fprintf(stderr, "qemu_create_displaysurface: malloc failed\n");
-        exit(1);
-    }
 
     surface->width = width;
     surface->height = height;
@@ -1577,10 +1566,6 @@ DisplaySurface* qemu_create_displaysurface(int width, int height, int bpp, int l
     surface->flags = QEMU_ALLOCATED_FLAG;
 #endif
     surface->data = (uint8_t*) qemu_mallocz(surface->linesize * surface->height);
-    if (surface->data == NULL) {
-        fprintf(stderr, "qemu_create_displaysurface: malloc failed\n");
-        exit(1);
-    }
 
     return surface;
 }
@@ -1596,10 +1581,6 @@ DisplaySurface* qemu_resize_displaysurface(DisplaySurface *surface,
         surface->data = (uint8_t*) qemu_realloc(surface->data, surface->linesize * surface->height);
     else
         surface->data = (uint8_t*) qemu_malloc(surface->linesize * surface->height);
-    if (surface->data == NULL) {
-        fprintf(stderr, "qemu_resize_displaysurface: malloc failed\n");
-        exit(1);
-    }
 #ifdef WORDS_BIGENDIAN
     surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;
 #else
@@ -1613,10 +1594,6 @@ DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp,
                                               int linesize, uint8_t *data)
 {
     DisplaySurface *surface = (DisplaySurface*) qemu_mallocz(sizeof(DisplaySurface));
-    if (surface == NULL) {
-        fprintf(stderr, "qemu_create_displaysurface_from: malloc failed\n");
-        exit(1);
-    }
 
     surface->width = width;
     surface->height = height;