All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: qemu-arm@nongnu.org
Cc: qemu-devel@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Joel Stanley" <joel@jms.id.au>,
	"Andrew Jeffery" <andrew@aj.id.au>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Steven Lee" <steven_lee@aspeedtech.com>,
	qemu-stable@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Francisco Iglesias" <frasse.iglesias@gmail.com>
Subject: [PATCH v2 01/12] aspeed/hace: Initialize g_autofree pointer
Date: Wed,  7 Jun 2023 06:39:32 +0200	[thread overview]
Message-ID: <20230607043943.1837186-2-clg@kaod.org> (raw)
In-Reply-To: <20230607043943.1837186-1-clg@kaod.org>

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>
---
 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 12a761f1f55d..b07506ec04ef 100644
--- a/hw/misc/aspeed_hace.c
+++ b/hw/misc/aspeed_hace.c
@@ -189,7 +189,7 @@ static void do_hash_operation(AspeedHACEState *s, int algo, bool sg_mode,
                               bool acc_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 niov = 0;
     int i;
-- 
2.40.1



  reply	other threads:[~2023-06-07  4:42 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07  4:39 [PATCH v2 00/12] aspeed: fixes and extensions Cédric Le Goater
2023-06-07  4:39 ` Cédric Le Goater [this message]
2023-06-07  7:53   ` [PATCH v2 01/12] aspeed/hace: Initialize g_autofree pointer Joel Stanley
2023-06-07  4:39 ` [PATCH v2 02/12] aspeed: Introduce a boot_rom region at the machine level Cédric Le Goater
2023-06-07  8:04   ` Joel Stanley
2023-06-07  4:39 ` [PATCH v2 03/12] aspeed: Use the boot_rom region of the fby35 machine Cédric Le Goater
2023-06-07  8:05   ` Joel Stanley
2023-06-29 10:57   ` Philippe Mathieu-Daudé
2023-06-07  4:39 ` [PATCH v2 04/12] hw/ssi: Add an "addr" property to SSIPeripheral Cédric Le Goater
2023-06-07  8:06   ` Joel Stanley
2023-06-07  8:28     ` Philippe Mathieu-Daudé
2023-06-07 14:15       ` Cédric Le Goater
2023-06-29 10:56         ` Philippe Mathieu-Daudé
2023-06-29 16:08           ` Cédric Le Goater
2023-06-07  4:39 ` [PATCH v2 05/12] hw/ssi: Introduce a ssi_get_cs() helper Cédric Le Goater
2023-06-07  8:10   ` Joel Stanley
2023-06-29 11:09   ` Philippe Mathieu-Daudé
2023-06-29 16:07     ` Cédric Le Goater
2023-06-07  4:39 ` [PATCH v2 06/12] aspeed/smc: Wire CS lines at reset Cédric Le Goater
2023-06-07 10:49   ` Joel Stanley
2023-06-07 17:05     ` Cédric Le Goater
2023-06-29 14:46   ` Cédric Le Goater
2023-06-07  4:39 ` [PATCH v2 07/12] hw/ssi: Check for duplicate addresses Cédric Le Goater
2023-06-07 10:52   ` Joel Stanley
2023-06-07  4:39 ` [PATCH v2 08/12] aspeed: Create flash devices only when defaults are enabled Cédric Le Goater
2023-06-07  4:39 ` [PATCH v2 09/12] m25p80: Introduce an helper to retrieve the BlockBackend of a device Cédric Le Goater
2023-06-07 10:55   ` Joel Stanley
2023-06-07  4:39 ` [PATCH v2 10/12] aspeed: Get the BlockBackend of FMC0 from the flash device Cédric Le Goater
2023-06-07 10:55   ` Joel Stanley
2023-06-07  4:39 ` [PATCH v2 11/12] aspeed: Introduce a "bmc-console" machine option Cédric Le Goater
2023-06-07 10:58   ` Joel Stanley
2023-06-07  4:39 ` [PATCH v2 12/12] target/arm: Allow users to set the number of VFP registers Cédric Le Goater
2023-06-07 11:06   ` Joel Stanley
2023-06-07 14:19     ` Cédric Le Goater
2023-06-08 10:19   ` Peter Maydell
2023-06-19 12:47   ` Mads Ynddal
2023-06-19 13:09     ` Cédric Le Goater
2023-06-19 13:46       ` Mads Ynddal
2023-06-19 13:41     ` Peter Maydell
2023-06-19 13:54       ` Richard Henderson

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=20230607043943.1837186-2-clg@kaod.org \
    --to=clg@kaod.org \
    --cc=alex.bennee@linaro.org \
    --cc=andrew@aj.id.au \
    --cc=frasse.iglesias@gmail.com \
    --cc=joel@jms.id.au \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=steven_lee@aspeedtech.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.