From 1eec614b36390be66430ed6dd0ce47a6f2f0ae1a Mon Sep 17 00:00:00 2001 From: aliguori Date: Thu, 5 Feb 2009 22:06:18 +0000 Subject: toplevel: remove error handling from qemu_malloc() callers (Avi Kivity) Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162 --- console.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'console.c') diff --git a/console.c b/console.c index 68ac970..3f2794e 100644 --- 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; -- cgit v1.1