Angel Pons submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Arthur Heymans: Looks good to me, approved Sam Lewis: Looks good to me, but someone else must approve
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>
---
M src/soc/ti/am335x/mmc.c
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/soc/ti/am335x/mmc.c b/src/soc/ti/am335x/mmc.c
index 395cf4f..b7b4f97 100644
--- a/src/soc/ti/am335x/mmc.c
+++ b/src/soc/ti/am335x/mmc.c
@@ -260,7 +260,7 @@
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);

To view, visit change 52054. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ieab3aaa2d07a928f27004b94132377d5dae935c0
Gerrit-Change-Number: 52054
Gerrit-PatchSet: 2
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Sam Lewis <sam.vr.lewis@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged