From: "Michael S. Tsirkin" <mst@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Sourish Dutta Sharma <sourishduttasharma770@gmail.com>,
qemu-devel@nongnu.org, pbonzini@redhat.com,
richard.henderson@linaro.org, eduardo@habkost.net,
marcel.apfelbaum@gmail.com
Subject: Re: [PATCH] hw/i386/fw_cfg: Use g_new() and g_new0() instead of g_malloc()
Date: Mon, 27 Apr 2026 06:04:18 -0400 [thread overview]
Message-ID: <20260427060403-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <883bd7fd-a9e2-49e3-9198-8333825f8aa1@redhat.com>
On Mon, Apr 27, 2026 at 12:02:57PM +0200, Thomas Huth wrote:
> On 24/02/2026 17.00, Sourish Dutta Sharma wrote:
> > Replace g_malloc() and g_malloc0() calls that calculate the allocation
> > size using sizeof() with the type-safe g_new() and g_new0() macros.
> >
> > This aligns the code with QEMU's coding style guidelines, improving
> > readability and protecting against potential integer overflow
> > vulnerabilities when allocating arrays.
> >
> > Signed-off-by: Sourish Duttta Sharma <sourishduttasharma770@gmail.com>
> > ---
> > hw/i386/fw_cfg.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Hi!
>
> Thanks for your patch! FWIW, fw_cfg is not really my turf, but since I was
> looking into malloc() related patches today, I noticed your patch which
> seems to have fallen through the cracks (sorry for this!), so I picked it up
> and added it to my latest pull request.
>
> Regards,
> Thomas
Thanks for doing this. FWIW
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
prev parent reply other threads:[~2026-04-27 10:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 16:00 [PATCH] hw/i386/fw_cfg: Use g_new() and g_new0() instead of g_malloc() Sourish Dutta Sharma
2026-04-27 10:02 ` Thomas Huth
2026-04-27 10:04 ` Michael S. Tsirkin [this message]
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=20260427060403-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sourishduttasharma770@gmail.com \
--cc=thuth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.