Commit 0d0266a53b4c80ab08c093c36bb3a7bbb29cc3e5
1 parent
487414f1
targets: 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@6530 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
12 changed files
with
0 additions
and
28 deletions
target-alpha/translate.c
... | ... | @@ -2466,8 +2466,6 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model) |
2466 | 2466 | uint64_t hwpcb; |
2467 | 2467 | |
2468 | 2468 | env = qemu_mallocz(sizeof(CPUAlphaState)); |
2469 | - if (!env) | |
2470 | - return NULL; | |
2471 | 2469 | cpu_exec_init(env); |
2472 | 2470 | alpha_translate_init(); |
2473 | 2471 | tlb_flush(env, 1); | ... | ... |
target-arm/helper.c
... | ... | @@ -248,8 +248,6 @@ CPUARMState *cpu_arm_init(const char *cpu_model) |
248 | 248 | if (id == 0) |
249 | 249 | return NULL; |
250 | 250 | env = qemu_mallocz(sizeof(CPUARMState)); |
251 | - if (!env) | |
252 | - return NULL; | |
253 | 251 | cpu_exec_init(env); |
254 | 252 | if (!inited) { |
255 | 253 | inited = 1; |
... | ... | @@ -468,8 +466,6 @@ int cpu_arm_handle_mmu_fault (CPUState *env, target_ulong address, int rw, |
468 | 466 | static void allocate_mmon_state(CPUState *env) |
469 | 467 | { |
470 | 468 | env->mmon_entry = malloc(sizeof (mmon_state)); |
471 | - if (!env->mmon_entry) | |
472 | - abort(); | |
473 | 469 | memset (env->mmon_entry, 0, sizeof (mmon_state)); |
474 | 470 | env->mmon_entry->cpu_env = env; |
475 | 471 | mmon_head = env->mmon_entry; | ... | ... |
target-cris/translate.c
target-i386/helper.c
target-i386/kvm.c
... | ... | @@ -97,8 +97,6 @@ static int kvm_has_msr_star(CPUState *env) |
97 | 97 | |
98 | 98 | kvm_msr_list = qemu_mallocz(sizeof(msr_list) + |
99 | 99 | msr_list.nmsrs * sizeof(msr_list.indices[0])); |
100 | - if (kvm_msr_list == NULL) | |
101 | - return 0; | |
102 | 100 | |
103 | 101 | kvm_msr_list->nmsrs = msr_list.nmsrs; |
104 | 102 | ret = kvm_ioctl(env->kvm_state, KVM_GET_MSR_INDEX_LIST, kvm_msr_list); | ... | ... |
target-m68k/helper.c
target-mips/translate.c
target-ppc/helper.c
... | ... | @@ -2761,8 +2761,6 @@ CPUPPCState *cpu_ppc_init (const char *cpu_model) |
2761 | 2761 | return NULL; |
2762 | 2762 | |
2763 | 2763 | env = qemu_mallocz(sizeof(CPUPPCState)); |
2764 | - if (!env) | |
2765 | - return NULL; | |
2766 | 2764 | cpu_exec_init(env); |
2767 | 2765 | ppc_translate_init(); |
2768 | 2766 | env->cpu_model_str = cpu_model; | ... | ... |
target-ppc/kvm_ppc.c
... | ... | @@ -33,10 +33,6 @@ int kvmppc_read_host_property(const char *node_path, const char *prop, |
33 | 33 | pathlen = snprintf(NULL, 0, "%s/%s/%s", PROC_DEVTREE_PATH, node_path, prop) |
34 | 34 | + 1; |
35 | 35 | path = qemu_malloc(pathlen); |
36 | - if (path == NULL) { | |
37 | - ret = -ENOMEM; | |
38 | - goto out; | |
39 | - } | |
40 | 36 | |
41 | 37 | snprintf(path, pathlen, "%s/%s/%s", PROC_DEVTREE_PATH, node_path, prop); |
42 | 38 | ... | ... |
target-ppc/translate_init.c
... | ... | @@ -9040,8 +9040,6 @@ static int create_new_table (opc_handler_t **table, unsigned char idx) |
9040 | 9040 | opc_handler_t **tmp; |
9041 | 9041 | |
9042 | 9042 | tmp = malloc(0x20 * sizeof(opc_handler_t)); |
9043 | - if (tmp == NULL) | |
9044 | - return -1; | |
9045 | 9043 | fill_new_table(tmp, 0x20); |
9046 | 9044 | table[idx] = (opc_handler_t *)((unsigned long)tmp | PPC_INDIRECT); |
9047 | 9045 | ... | ... |
target-sh4/translate.c
... | ... | @@ -277,8 +277,6 @@ CPUSH4State *cpu_sh4_init(const char *cpu_model) |
277 | 277 | if (!def) |
278 | 278 | return NULL; |
279 | 279 | env = qemu_mallocz(sizeof(CPUSH4State)); |
280 | - if (!env) | |
281 | - return NULL; | |
282 | 280 | env->features = def->features; |
283 | 281 | cpu_exec_init(env); |
284 | 282 | sh4_translate_init(); | ... | ... |
target-sparc/helper.c