aboutsummaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 22:06:18 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 22:06:18 +0000
commit1eec614b36390be66430ed6dd0ce47a6f2f0ae1a (patch)
treefa9174028d54ea9a531a77d05996688fc704fadd /console.c
parent0d0266a53b4c80ab08c093c36bb3a7bbb29cc3e5 (diff)
toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'console.c')
-rw-r--r--console.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/console.c b/console.c
index 68ac970654..3f2794e16d 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;