From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: mrezanin@redhat.com, qemu-devel@nongnu.org,
qemu-s390x <qemu-s390x@nongnu.org>
Cc: Thomas Huth <thuth@redhat.com>, Cornelia Huck <cohuck@redhat.com>
Subject: Re: [PATCH v3] Add missing initialization for g_autofree variables
Date: Mon, 15 Mar 2021 11:21:23 +0100 [thread overview]
Message-ID: <b10b7f11-2954-f1bb-8824-8c7125c80bfc@redhat.com> (raw)
In-Reply-To: <20210315101352.152888-1-mrezanin@redhat.com>
On 3/15/21 11:13 AM, mrezanin@redhat.com wrote:
> From: Miroslav Rezanina <mrezanin@redhat.com>
>
> When declaring g_autofree variable without inicialization, compiler
Typo "initialization"
> will raise "may be used uninitialized in this function" warning due
> to automatic free handling.
>
> This is mentioned in docs/devel/style.rst (quote from section
> "Automatic memory deallocation"):
>
> * Variables declared with g_auto* MUST always be initialized,
> otherwise the cleanup function will use uninitialized stack memory
>
> Add inicialization for these declarations to prevent the warning and
"initialization"
> comply with coding style.
>
> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
>
> ---
> * v3:
> -- allocate in s390_pci_update_dma_avail instead of NULL init
>
> * v2:
> -- Removed fixes in hw/remote/memory.c and hw/remote/proxy.c
> fixed by patch sent by Zenghui Yu (multi-process: Initialize
> variables declared with g_auto*)
> ---
> hw/s390x/s390-pci-vfio.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
Maybe "hw/s390x/s390-pci-vfio" prefix in subject?
Otherwise:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
next prev parent reply other threads:[~2021-03-15 10:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 10:13 [PATCH v3] Add missing initialization for g_autofree variables mrezanin
2021-03-15 10:21 ` Philippe Mathieu-Daudé [this message]
2021-03-15 10:42 ` Cornelia Huck
2021-03-15 13:31 ` Matthew Rosato
2021-03-15 11:34 ` Thomas Huth
2021-03-15 17:32 ` Cornelia Huck
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=b10b7f11-2954-f1bb-8824-8c7125c80bfc@redhat.com \
--to=philmd@redhat.com \
--cc=cohuck@redhat.com \
--cc=mrezanin@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--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 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).