From: Sam Edwards Date: Thu, 18 May 2023 19:47:07 +0000 (-0600) Subject: mmc: fix improper use of memset X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=229d689e3c32164875667da282e496b858dbc608;p=u-boot.git mmc: fix improper use of memset Buffers created through DEFINE_(CACHE_)ALIGN_BUFFER are actually pointers to the real underlying buffer. Using sizeof(...) is not appropriate in this case. Signed-off-by: Sam Edwards Reviewed-by: Peng Fan --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 1af6af82e6..72c1076c56 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2262,7 +2262,7 @@ static int mmc_startup_v4(struct mmc *mmc) return 0; if (!mmc->ext_csd) - memset(ext_csd_bkup, 0, sizeof(ext_csd_bkup)); + memset(ext_csd_bkup, 0, MMC_MAX_BLOCK_LEN); err = mmc_send_ext_csd(mmc, ext_csd); if (err)