From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <rth@twiddle.net>,
"Emilio G . Cota" <cota@braap.org>,
peterx@redhat.com
Subject: [PATCH 1/3] qht: Zero-initialize qht_map
Date: Mon, 29 Sep 2025 15:07:59 -0400 [thread overview]
Message-ID: <20250929190801.931989-2-peterx@redhat.com> (raw)
In-Reply-To: <20250929190801.931989-1-peterx@redhat.com>
QEMU almost always do this across the tree except QHT. This prepares for
rcu to track double free.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
util/qht.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/qht.c b/util/qht.c
index 208c2f4b32..872d9f9cec 100644
--- a/util/qht.c
+++ b/util/qht.c
@@ -441,7 +441,7 @@ static struct qht_map *qht_map_create(size_t n_buckets)
struct qht_map *map;
size_t i;
- map = g_malloc(sizeof(*map));
+ map = g_malloc0(sizeof(*map));
map->n_buckets = n_buckets;
map->n_added_buckets = 0;
--
2.50.1
next prev parent reply other threads:[~2025-09-29 19:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-29 19:07 [PATCH 0/3] rcu: Detect accidental reuse of rcu head Peter Xu
2025-09-29 19:07 ` Peter Xu [this message]
2025-09-29 19:08 ` [PATCH 2/3] tests/test-rcu-*: Zero-initialize allocated elements Peter Xu
2025-09-29 19:08 ` [PATCH 3/3] rcu: Avoid double rcu frees Peter Xu
2025-09-30 9:19 ` Peter Maydell
2025-09-30 16:14 ` Peter Xu
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=20250929190801.931989-2-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=cota@braap.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@redhat.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).