]> git.proxmox.com Git - qemu.git/commitdiff
targets: remove error handling from qemu_malloc() callers (Avi Kivity)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 5 Feb 2009 22:06:11 +0000 (22:06 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 5 Feb 2009 22:06:11 +0000 (22:06 +0000)
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

12 files changed:
target-alpha/translate.c
target-arm/helper.c
target-cris/translate.c
target-i386/helper.c
target-i386/kvm.c
target-m68k/helper.c
target-mips/translate.c
target-ppc/helper.c
target-ppc/kvm_ppc.c
target-ppc/translate_init.c
target-sh4/translate.c
target-sparc/helper.c

index 3affb219836160125c50b83e9013927803abe0b1..e27376d75eb8f1141868f3530e0d7a21538820b5 100644 (file)
@@ -2466,8 +2466,6 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model)
     uint64_t hwpcb;
 
     env = qemu_mallocz(sizeof(CPUAlphaState));
-    if (!env)
-        return NULL;
     cpu_exec_init(env);
     alpha_translate_init();
     tlb_flush(env, 1);
index 26fd6d017af49c2bc21e94eccaa338b761990daf..3250fb8c1f1e1009c4083bed51a0fb70315f50b0 100644 (file)
@@ -248,8 +248,6 @@ CPUARMState *cpu_arm_init(const char *cpu_model)
     if (id == 0)
         return NULL;
     env = qemu_mallocz(sizeof(CPUARMState));
-    if (!env)
-        return NULL;
     cpu_exec_init(env);
     if (!inited) {
         inited = 1;
@@ -468,8 +466,6 @@ int cpu_arm_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
 static void allocate_mmon_state(CPUState *env)
 {
     env->mmon_entry = malloc(sizeof (mmon_state));
-    if (!env->mmon_entry)
-        abort();
     memset (env->mmon_entry, 0, sizeof (mmon_state));
     env->mmon_entry->cpu_env = env;
     mmon_head = env->mmon_entry;
index 288262d7b5c8c6479e5d73b66c508c450bcd9459..f575e63c66ffcfd995858ea6619e2e1b377c9a1a 100644 (file)
@@ -3400,8 +3400,6 @@ CPUCRISState *cpu_cris_init (const char *cpu_model)
        int i;
 
        env = qemu_mallocz(sizeof(CPUCRISState));
-       if (!env)
-               return NULL;
 
        cpu_exec_init(env);
        cpu_reset(env);
index e55de966274fcab6fca2b51b4b89aba0c93f3e70..5950c976cce7144cdb6173013c0986ec9ca63bdc 100644 (file)
@@ -1645,8 +1645,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
     static int inited;
 
     env = qemu_mallocz(sizeof(CPUX86State));
-    if (!env)
-        return NULL;
     cpu_exec_init(env);
     env->cpu_model_str = cpu_model;
 
index 49766e2579d1b868663c8bd33900304f13ab1e59..0834e6285373597e91a5994854ffa7880b6a294a 100644 (file)
@@ -97,8 +97,6 @@ static int kvm_has_msr_star(CPUState *env)
 
         kvm_msr_list = qemu_mallocz(sizeof(msr_list) +
                                     msr_list.nmsrs * sizeof(msr_list.indices[0]));
-        if (kvm_msr_list == NULL)
-            return 0;
 
         kvm_msr_list->nmsrs = msr_list.nmsrs;
         ret = kvm_ioctl(env->kvm_state, KVM_GET_MSR_INDEX_LIST, kvm_msr_list);
index 076ea353c8004daa5e2ed8dcdb659b2839d637ac..7eb21ddd3d702650f8f3deeae7052e5365eccb5b 100644 (file)
@@ -166,8 +166,6 @@ CPUM68KState *cpu_m68k_init(const char *cpu_model)
     static int inited;
 
     env = qemu_mallocz(sizeof(CPUM68KState));
-    if (!env)
-        return NULL;
     cpu_exec_init(env);
     if (!inited) {
         inited = 1;
index b447b983f6f363d350a2c8739e72dc5980481565..d659afb61a716465007d8af1b76fa3d2bc1f7842 100644 (file)
@@ -8476,8 +8476,6 @@ CPUMIPSState *cpu_mips_init (const char *cpu_model)
     if (!def)
         return NULL;
     env = qemu_mallocz(sizeof(CPUMIPSState));
-    if (!env)
-        return NULL;
     env->cpu_model = def;
 
     cpu_exec_init(env);
index 3bd1d45c8ad43d86c10da4c5d0667f17850341be..fc62a635f0e0bfeff540bb136099d6e09154f1ba 100644 (file)
@@ -2761,8 +2761,6 @@ CPUPPCState *cpu_ppc_init (const char *cpu_model)
         return NULL;
 
     env = qemu_mallocz(sizeof(CPUPPCState));
-    if (!env)
-        return NULL;
     cpu_exec_init(env);
     ppc_translate_init();
     env->cpu_model_str = cpu_model;
index 82c0f42098238d623a7f069386a68b397e3061dc..10cfdb3cf1ebc77ccbba020e00684dc60ace6e50 100644 (file)
@@ -33,10 +33,6 @@ int kvmppc_read_host_property(const char *node_path, const char *prop,
     pathlen = snprintf(NULL, 0, "%s/%s/%s", PROC_DEVTREE_PATH, node_path, prop)
               + 1;
     path = qemu_malloc(pathlen);
-    if (path == NULL) {
-        ret = -ENOMEM;
-        goto out;
-    }
 
     snprintf(path, pathlen, "%s/%s/%s", PROC_DEVTREE_PATH, node_path, prop);
 
index 957047929aa6846f84d054088fcd9cb2fe14d5b7..c8089239805ba92568fd1cb0549526bcc510a1c9 100644 (file)
@@ -9040,8 +9040,6 @@ static int create_new_table (opc_handler_t **table, unsigned char idx)
     opc_handler_t **tmp;
 
     tmp = malloc(0x20 * sizeof(opc_handler_t));
-    if (tmp == NULL)
-        return -1;
     fill_new_table(tmp, 0x20);
     table[idx] = (opc_handler_t *)((unsigned long)tmp | PPC_INDIRECT);
 
index 6c9dff591a2258bf1b317dec73e35703320a43bf..80ea851116a96e6b5249cad0c0b83e18cedf767a 100644 (file)
@@ -277,8 +277,6 @@ CPUSH4State *cpu_sh4_init(const char *cpu_model)
     if (!def)
        return NULL;
     env = qemu_mallocz(sizeof(CPUSH4State));
-    if (!env)
-       return NULL;
     env->features = def->features;
     cpu_exec_init(env);
     sh4_translate_init();
index a2758808515a8acb9d6e7f7b6572fe4db4cf2655..1a06525764462128a63b956e7791d17963154f34 100644 (file)
@@ -713,8 +713,6 @@ CPUSPARCState *cpu_sparc_init(const char *cpu_model)
     CPUSPARCState *env;
 
     env = qemu_mallocz(sizeof(CPUSPARCState));
-    if (!env)
-        return NULL;
     cpu_exec_init(env);
 
     gen_intermediate_code_init(env);