From: Marc-André Lureau Date: Thu, 28 Mar 2024 10:20:42 +0000 (+0400) Subject: hw/sdhci: fix -Werror=maybe-uninitialized false-positive X-Git-Tag: v9.2.0-rc0~64^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea34d1dd968956ec418c4278b39b6c44bb606d9c;p=thirdparty%2Fqemu.git 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 Reviewed-by: Alex Bennée --- diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 87122e4245c..ed014993910 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) {