1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

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>
This commit is contained in:
Nico Huber 2021-06-09 18:08:48 +02:00 committed by Nico Huber
parent a6e4df6624
commit 6d438d4295

View File

@ -947,7 +947,7 @@ static int dummy_init(void)
{ {
struct stat image_stat; struct stat image_stat;
struct emu_data *data = calloc(1, sizeof(struct emu_data)); struct emu_data *data = calloc(1, sizeof(*data));
if (!data) { if (!data) {
msg_perr("Out of memory!\n"); msg_perr("Out of memory!\n");
return 1; return 1;