From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, arei.gonglei@huawei.com,
thuth@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH v2 6/6] translate-all: Use g_try_malloc() for dynamic translator buffer
Date: Wed, 4 Feb 2015 11:26:07 +0100 [thread overview]
Message-ID: <1423045567-29855-7-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1423045567-29855-1-git-send-email-armbru@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 <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
---
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
next prev parent reply other threads:[~2015-02-04 10:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 10:26 [Qemu-devel] [PATCH v2 0/6] Trivial cleanups around g_malloc() Markus Armbruster
2015-02-04 10:26 ` [Qemu-devel] [PATCH v2 1/6] onenand: g_malloc() can't fail, bury dead error handling Markus Armbruster
2015-02-04 10:26 ` [Qemu-devel] [PATCH v2 2/6] rtl8139: " Markus Armbruster
2015-02-04 10:26 ` [Qemu-devel] [PATCH v2 3/6] kvm: " Markus Armbruster
2015-02-04 10:26 ` [Qemu-devel] [PATCH v2 4/6] rdma: g_malloc0() " Markus Armbruster
2015-02-04 10:26 ` [Qemu-devel] [PATCH v2 5/6] vnc: g_realloc() " Markus Armbruster
2015-02-04 10:26 ` Markus Armbruster [this message]
2015-02-08 10:51 ` [Qemu-devel] [PATCH v2 0/6] Trivial cleanups around g_malloc() Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423045567-29855-7-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=thuth@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).