]> git.ipfire.org Git - thirdparty/qemu.git/commit
aspeed/hace: Initialize g_autofree pointer
authorCédric Le Goater <clg@kaod.org>
Wed, 7 Jun 2023 04:39:32 +0000 (06:39 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 16 Jun 2023 13:15:56 +0000 (16:15 +0300)
commitfb8b14025bf17f982c7b2c46031726ea4b6bc341
treed6d42031d3cd09fb6bb914253956e32dd77c9e0e
parent4a83e27b21289dd5ae06fddf113e0d1ae19c42ad
aspeed/hace: Initialize g_autofree pointer

As mentioned in docs/devel/style.rst "Automatic memory deallocation":

* Variables declared with g_auto* MUST always be initialized,
  otherwise the cleanup function will use uninitialized stack memory

This avoids QEMU to coredump when running the "hash test" command
under Zephyr.

Cc: Steven Lee <steven_lee@aspeedtech.com>
Cc: Joel Stanley <joel@jms.id.au>
Cc: qemu-stable@nongnu.org
Fixes: c5475b3f9a ("hw: Model ASPEED's Hash and Crypto Engine")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20230421131547.2177449-1-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
(cherry picked from commit c8f48b120b31f6bbe33135ef5d478e485c37e3c2)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/misc/aspeed_hace.c