From 57b6447e0a904b8000696cd0a988744995d01905 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 23 Oct 2022 19:48:12 +0800 Subject: [PATCH] Fix error: mmcsd/mmcsd_sdio.c:2669:35: error: 'buffer' may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Xiang Xiao --- drivers/mmcsd/mmcsd_sdio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index 48c5ab8d34..3b8cabf379 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -2659,6 +2659,8 @@ static int mmcsd_read_csd(FAR struct mmcsd_state_s *priv) return -EPERM; } + memset(buffer, 0, sizeof(buffer)); + #if defined(CONFIG_SDIO_DMA) && defined(CONFIG_ARCH_HAVE_SDIO_PREFLIGHT) /* If we think we are going to perform a DMA transfer, make sure that we * will be able to before we commit the card to the operation.