Skip to content
Snippets Groups Projects
user avatar
Miroslav Rezanina authored
When declaring g_autofree variable without initialization, compiler
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 initialization for these declarations to prevent the warning and
comply with coding style.

Signed-off-by: default avatarMiroslav Rezanina <mrezanin@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Fixes: cd7498d0 ("s390x/pci: Add routine to get the vfio dma available count")
Fixes: 1e7552ff ("s390x/pci: get zPCI function info from host")
Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
Tested-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
Message-Id: <20210315101352.152888-1-mrezanin@redhat.com>
Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
5793f5aa
History