Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Anastasia Klimchuk: Looks good to me, approved
dummyflasher: Replace another case of `sizeof(struct ...)`

Using the pointer's type instead ensures that we get the right size even
if code changes in the future.

Change-Id: If88ba394095f86c598dcc5cf1751e1c23b132d04
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/55358
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
---
M dummyflasher.c
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dummyflasher.c b/dummyflasher.c
index b75cddb..6a75506 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -947,7 +947,7 @@
{
struct stat image_stat;

- struct emu_data *data = calloc(1, sizeof(struct emu_data));
+ struct emu_data *data = calloc(1, sizeof(*data));
if (!data) {
msg_perr("Out of memory!\n");
return 1;

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If88ba394095f86c598dcc5cf1751e1c23b132d04
Gerrit-Change-Number: 55358
Gerrit-PatchSet: 3
Gerrit-Owner: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged