From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVCMR-0005zD-9n for qemu-devel@nongnu.org; Thu, 05 Feb 2009 17:06:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVCMQ-0005yk-Iz for qemu-devel@nongnu.org; Thu, 05 Feb 2009 17:06:14 -0500 Received: from [199.232.76.173] (port=44925 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVCMQ-0005yS-A3 for qemu-devel@nongnu.org; Thu, 05 Feb 2009 17:06:14 -0500 Received: from savannah.gnu.org ([199.232.41.3]:35502 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVCMP-0002T4-AV for qemu-devel@nongnu.org; Thu, 05 Feb 2009 17:06:13 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LVCMO-0007hn-G6 for qemu-devel@nongnu.org; Thu, 05 Feb 2009 22:06:12 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LVCMN-0007hj-VB for qemu-devel@nongnu.org; Thu, 05 Feb 2009 22:06:12 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Thu, 05 Feb 2009 22:06:11 +0000 Subject: [Qemu-devel] [6530] targets: remove error handling from qemu_malloc() callers ( Avi Kivity) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6530 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6530 Author: aliguori Date: 2009-02-05 22:06:11 +0000 (Thu, 05 Feb 2009) Log Message: ----------- targets: remove error handling from qemu_malloc() callers (Avi Kivity) Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/target-alpha/translate.c trunk/target-arm/helper.c trunk/target-cris/translate.c trunk/target-i386/helper.c trunk/target-i386/kvm.c trunk/target-m68k/helper.c trunk/target-mips/translate.c trunk/target-ppc/helper.c trunk/target-ppc/kvm_ppc.c trunk/target-ppc/translate_init.c trunk/target-sh4/translate.c trunk/target-sparc/helper.c Modified: trunk/target-alpha/translate.c =================================================================== --- trunk/target-alpha/translate.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-alpha/translate.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -2466,8 +2466,6 @@ uint64_t hwpcb; env = qemu_mallocz(sizeof(CPUAlphaState)); - if (!env) - return NULL; cpu_exec_init(env); alpha_translate_init(); tlb_flush(env, 1); Modified: trunk/target-arm/helper.c =================================================================== --- trunk/target-arm/helper.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-arm/helper.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -248,8 +248,6 @@ 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 @@ 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; Modified: trunk/target-cris/translate.c =================================================================== --- trunk/target-cris/translate.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-cris/translate.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -3400,8 +3400,6 @@ int i; env = qemu_mallocz(sizeof(CPUCRISState)); - if (!env) - return NULL; cpu_exec_init(env); cpu_reset(env); Modified: trunk/target-i386/helper.c =================================================================== --- trunk/target-i386/helper.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-i386/helper.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -1645,8 +1645,6 @@ static int inited; env = qemu_mallocz(sizeof(CPUX86State)); - if (!env) - return NULL; cpu_exec_init(env); env->cpu_model_str = cpu_model; Modified: trunk/target-i386/kvm.c =================================================================== --- trunk/target-i386/kvm.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-i386/kvm.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -97,8 +97,6 @@ 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); Modified: trunk/target-m68k/helper.c =================================================================== --- trunk/target-m68k/helper.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-m68k/helper.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -166,8 +166,6 @@ static int inited; env = qemu_mallocz(sizeof(CPUM68KState)); - if (!env) - return NULL; cpu_exec_init(env); if (!inited) { inited = 1; Modified: trunk/target-mips/translate.c =================================================================== --- trunk/target-mips/translate.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-mips/translate.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -8476,8 +8476,6 @@ if (!def) return NULL; env = qemu_mallocz(sizeof(CPUMIPSState)); - if (!env) - return NULL; env->cpu_model = def; cpu_exec_init(env); Modified: trunk/target-ppc/helper.c =================================================================== --- trunk/target-ppc/helper.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-ppc/helper.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -2761,8 +2761,6 @@ return NULL; env = qemu_mallocz(sizeof(CPUPPCState)); - if (!env) - return NULL; cpu_exec_init(env); ppc_translate_init(); env->cpu_model_str = cpu_model; Modified: trunk/target-ppc/kvm_ppc.c =================================================================== --- trunk/target-ppc/kvm_ppc.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-ppc/kvm_ppc.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -33,10 +33,6 @@ 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); Modified: trunk/target-ppc/translate_init.c =================================================================== --- trunk/target-ppc/translate_init.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-ppc/translate_init.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -9040,8 +9040,6 @@ 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); Modified: trunk/target-sh4/translate.c =================================================================== --- trunk/target-sh4/translate.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-sh4/translate.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -277,8 +277,6 @@ if (!def) return NULL; env = qemu_mallocz(sizeof(CPUSH4State)); - if (!env) - return NULL; env->features = def->features; cpu_exec_init(env); sh4_translate_init(); Modified: trunk/target-sparc/helper.c =================================================================== --- trunk/target-sparc/helper.c 2009-02-05 22:06:05 UTC (rev 6529) +++ trunk/target-sparc/helper.c 2009-02-05 22:06:11 UTC (rev 6530) @@ -713,8 +713,6 @@ CPUSPARCState *env; env = qemu_mallocz(sizeof(CPUSPARCState)); - if (!env) - return NULL; cpu_exec_init(env); gen_intermediate_code_init(env);