summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2024-03-28 14:20:42 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2024-10-02 16:14:29 +0400
commitea34d1dd968956ec418c4278b39b6c44bb606d9c (patch)
treebcc26c0a0436b9772cc9eab5156a694529c6fbab
parentfa7e5e9e1c52b2b197f478265b221e766679a236 (diff)
downloadfocaccia-qemu-ea34d1dd968956ec418c4278b39b6c44bb606d9c.tar.gz
focaccia-qemu-ea34d1dd968956ec418c4278b39b6c44bb606d9c.zip
hw/sdhci: fix -Werror=maybe-uninitialized false-positive
../hw/sd/sdhci.c:846:16: error: ‘res’ may be used uninitialized [-Werror=maybe-uninitialized]

False-positive, because "length" is non-null.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
-rw-r--r--hw/sd/sdhci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 87122e4245..ed01499391 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -747,7 +747,7 @@ static void sdhci_do_adma(SDHCIState *s)
     const uint16_t block_size = s->blksize & BLOCK_SIZE_MASK;
     const MemTxAttrs attrs = { .memory = true };
     ADMADescr dscr = {};
-    MemTxResult res;
+    MemTxResult res = MEMTX_ERROR;
     int i;
 
     if (s->trnmod & SDHC_TRNS_BLK_CNT_EN && !s->blkcnt) {