From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG9PD-0004tK-Sy for qemu-devel@nongnu.org; Tue, 27 Jan 2015 11:54:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YG99y-0002hO-5Y for qemu-devel@nongnu.org; Tue, 27 Jan 2015 11:42:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG99x-0002h5-Sq for qemu-devel@nongnu.org; Tue, 27 Jan 2015 11:38:38 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0RGcaS3017776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 27 Jan 2015 11:38:36 -0500 From: Markus Armbruster Date: Tue, 27 Jan 2015 17:38:31 +0100 Message-Id: <1422376711-31648-7-git-send-email-armbru@redhat.com> In-Reply-To: <1422376711-31648-1-git-send-email-armbru@redhat.com> References: <1422376711-31648-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 6/6] translate-all: Use g_try_malloc() for dynamic translator buffer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@redhat.com The USE_MMAP code can fail, and the caller handles the failure already. Let the !USE_MMAP code fail as well, for consistency. Signed-off-by: Markus Armbruster --- translate-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translate-all.c b/translate-all.c index 4a1b64f..9f47ce7 100644 --- a/translate-all.c +++ b/translate-all.c @@ -631,7 +631,7 @@ static inline void *alloc_code_gen_buffer(void) #else static inline void *alloc_code_gen_buffer(void) { - void *buf = g_malloc(tcg_ctx.code_gen_buffer_size); + void *buf = g_try_malloc(tcg_ctx.code_gen_buffer_size); if (buf == NULL) { return NULL; -- 1.9.3