[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH v2 6/6] translate-all: Use g_try_malloc() for dyna
From: |
Markus Armbruster |
Subject: |
[Qemu-trivial] [PATCH v2 6/6] translate-all: Use g_try_malloc() for dynamic translator buffer |
Date: |
Wed, 4 Feb 2015 11:26:07 +0100 |
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Gonglei <address@hidden>
---
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
- [Qemu-trivial] [PATCH v2 0/6] Trivial cleanups around g_malloc(), Markus Armbruster, 2015/02/04
- [Qemu-trivial] [PATCH v2 2/6] rtl8139: g_malloc() can't fail, bury dead error handling, Markus Armbruster, 2015/02/04
- [Qemu-trivial] [PATCH v2 3/6] kvm: g_malloc() can't fail, bury dead error handling, Markus Armbruster, 2015/02/04
- [Qemu-trivial] [PATCH v2 6/6] translate-all: Use g_try_malloc() for dynamic translator buffer,
Markus Armbruster <=
- [Qemu-trivial] [PATCH v2 4/6] rdma: g_malloc0() can't fail, bury dead error handling, Markus Armbruster, 2015/02/04
- [Qemu-trivial] [PATCH v2 5/6] vnc: g_realloc() can't fail, bury dead error handling, Markus Armbruster, 2015/02/04
- [Qemu-trivial] [PATCH v2 1/6] onenand: g_malloc() can't fail, bury dead error handling, Markus Armbruster, 2015/02/04
- Re: [Qemu-trivial] [PATCH v2 0/6] Trivial cleanups around g_malloc(), Michael Tokarev, 2015/02/08