Anastasia Klimchuk submitted this change.

View Change


Approvals: build bot (Jenkins): Verified Anastasia Klimchuk: Looks good to me, approved
dummyflasher: fix propagation of register_*_master() return values

This patch checks return value of register_*_master()
so that in case of an error this error is not ignored anymore.

TEST=ninja test

Change-Id: I3a7eeb3cdd814db18b0717ae8b40ecadb4c32f7c
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/72430
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
---
M dummyflasher.c
1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/dummyflasher.c b/dummyflasher.c
index 1960e92..93f183a 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -1345,6 +1345,7 @@

static int dummy_init(const struct programmer_cfg *cfg)
{
+ int ret = 0;
struct stat image_stat;

struct emu_data *data = calloc(1, sizeof(*data));
@@ -1410,15 +1411,15 @@
}

if (dummy_buses_supported & BUS_PROG)
- register_opaque_master(&opaque_master_dummyflasher, data);
+ ret |= register_opaque_master(&opaque_master_dummyflasher, data);
if (dummy_buses_supported & BUS_NONSPI)
- register_par_master(&par_master_dummyflasher,
- dummy_buses_supported & BUS_NONSPI,
- data);
+ ret |= register_par_master(&par_master_dummyflasher,
+ dummy_buses_supported & BUS_NONSPI,
+ data);
if (dummy_buses_supported & BUS_SPI)
- register_spi_master(&spi_master_dummyflasher, data);
+ ret |= register_spi_master(&spi_master_dummyflasher, data);

- return 0;
+ return ret;
}

const struct programmer_entry programmer_dummy = {

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3a7eeb3cdd814db18b0717ae8b40ecadb4c32f7c
Gerrit-Change-Number: 72430
Gerrit-PatchSet: 2
Gerrit-Owner: Alexander Goncharov <chat@joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged