summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-04-02 18:05:31 +0200
committerAngel Pons <th3fanbus@gmail.com>2021-04-04 09:58:26 +0000
commitda335abfe7b7aa097b7c12585cc2739087c87e9a (patch)
tree48d4899942818f4686c1eae87b59460fb6617e5e /src/soc
parent0887fc4dbc04c19fb555cd63bed1d50e6f674790 (diff)
soc/ti/am335x/mmc.c: Fix memset length argument
The sizeof() operator was being applied to a pointer-to-struct type. Correct this, so that the entire struct space gets cleared. Change-Id: Ieab3aaa2d07a928f27004b94132377d5dae935c0 Found-by: Coverity CID 1451732 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/52054 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Sam Lewis <sam.vr.lewis@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/ti/am335x/mmc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/soc/ti/am335x/mmc.c b/src/soc/ti/am335x/mmc.c
index 395cf4fe0b..b7b4f97c70 100644
--- a/src/soc/ti/am335x/mmc.c
+++ b/src/soc/ti/am335x/mmc.c
@@ -260,7 +260,7 @@ int am335x_mmc_init_storage(struct am335x_mmc_host *mmc_host)
int err = 0;
struct sd_mmc_ctrlr *mmc_ctrlr = &mmc_host->sd_mmc_ctrlr;
- memset(mmc_ctrlr, 0, sizeof(mmc_ctrlr));
+ memset(mmc_ctrlr, 0, sizeof(*mmc_ctrlr));
err = am335x_mmc_init(mmc_host->reg);