mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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
This commit is contained in:
parent
0d0266a53b
commit
1eec614b36
25 changed files with 25 additions and 254 deletions
16
vl.c
16
vl.c
|
@ -546,8 +546,6 @@ QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
|
|||
QEMUPutMouseEntry *s, *cursor;
|
||||
|
||||
s = qemu_mallocz(sizeof(QEMUPutMouseEntry));
|
||||
if (!s)
|
||||
return NULL;
|
||||
|
||||
s->qemu_put_mouse_event = func;
|
||||
s->qemu_put_mouse_event_opaque = opaque;
|
||||
|
@ -1098,8 +1096,6 @@ static QEMUClock *qemu_new_clock(int type)
|
|||
{
|
||||
QEMUClock *clock;
|
||||
clock = qemu_mallocz(sizeof(QEMUClock));
|
||||
if (!clock)
|
||||
return NULL;
|
||||
clock->type = type;
|
||||
return clock;
|
||||
}
|
||||
|
@ -2808,10 +2804,6 @@ DisplayState *get_displaystate(void)
|
|||
static void dumb_display_init(void)
|
||||
{
|
||||
DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
|
||||
if (ds == NULL) {
|
||||
fprintf(stderr, "dumb_display_init: DisplayState allocation failed\n");
|
||||
exit(1);
|
||||
}
|
||||
ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4);
|
||||
register_displaystate(ds);
|
||||
}
|
||||
|
@ -2863,8 +2855,6 @@ int qemu_set_fd_handler2(int fd,
|
|||
goto found;
|
||||
}
|
||||
ioh = qemu_mallocz(sizeof(IOHandlerRecord));
|
||||
if (!ioh)
|
||||
return -1;
|
||||
ioh->next = first_io_handler;
|
||||
first_io_handler = ioh;
|
||||
found:
|
||||
|
@ -2902,8 +2892,6 @@ int qemu_add_polling_cb(PollingFunc *func, void *opaque)
|
|||
{
|
||||
PollingEntry **ppe, *pe;
|
||||
pe = qemu_mallocz(sizeof(PollingEntry));
|
||||
if (!pe)
|
||||
return -1;
|
||||
pe->func = func;
|
||||
pe->opaque = opaque;
|
||||
for(ppe = &first_polling_entry; *ppe != NULL; ppe = &(*ppe)->next);
|
||||
|
@ -3273,8 +3261,6 @@ QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
|
|||
{
|
||||
QEMUBH *bh;
|
||||
bh = qemu_mallocz(sizeof(QEMUBH));
|
||||
if (!bh)
|
||||
return NULL;
|
||||
bh->cb = cb;
|
||||
bh->opaque = opaque;
|
||||
bh->next = first_bh;
|
||||
|
@ -3432,8 +3418,6 @@ VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
|
|||
VMChangeStateEntry *e;
|
||||
|
||||
e = qemu_mallocz(sizeof (*e));
|
||||
if (!e)
|
||||
return NULL;
|
||||
|
||||
e->cb = cb;
|
||||
e->opaque = opaque;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue