- pci-host: designware: Limit value range of iATU viewport register - hmat acpi: Fix out of bounds access due to missing use of indirection - migration: Skip only empty block devices - aspeed/hace: Initialize g_autofree pointer - hw/net/vmxnet3: Fix guest-triggerable assert() - qxl: don't assert() if device isn't yet initialized - Avoid unaligned fetch in ladr_match() - linux-user: Fix waitid return of siginfo_t and rusage - hw/net/lan9118: Replace magic '2048' value by MIL_TXFIFO_SIZE definition - stdvga: fix screen blanking - virtio-net: drop too short packets early - ebpf: replace deprecated bpf_program__set_socket_filter - vhsot-user: only read reply of SET_LOG_BASE from vq 0 - cpu: add Tengyun S5000C cpu support - hw/virtio: Fix obtain the buffer id from the last descriptor - hw/core: ensure kernel_end never gets used undefined Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com> (cherry picked from commit 1f9e476e96edb07e34e0133a312f478ddab4b6ff)
51 lines
1.8 KiB
Diff
51 lines
1.8 KiB
Diff
From 4f957cd7c79c7820e6218560efde3de142d1caf1 Mon Sep 17 00:00:00 2001
|
|
From: zhujun2 <zhujun2_yewu@cmss.chinamobile.com>
|
|
Date: Tue, 13 Aug 2024 23:24:29 -0700
|
|
Subject: [PATCH] aspeed/hace: Initialize g_autofree pointer
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
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: zhujun2 <zhujun2_yewu@cmss.chinamobile.com>
|
|
---
|
|
hw/misc/aspeed_hace.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c
|
|
index 10f00e65f4..1192322f0a 100644
|
|
--- a/hw/misc/aspeed_hace.c
|
|
+++ b/hw/misc/aspeed_hace.c
|
|
@@ -97,7 +97,7 @@ static int hash_algo_lookup(uint32_t reg)
|
|
static void do_hash_operation(AspeedHACEState *s, int algo, bool sg_mode)
|
|
{
|
|
struct iovec iov[ASPEED_HACE_MAX_SG];
|
|
- g_autofree uint8_t *digest_buf;
|
|
+ g_autofree uint8_t *digest_buf = NULL;
|
|
size_t digest_len = 0;
|
|
int i;
|
|
|
|
--
|
|
2.41.0.windows.1
|
|
|