Alexander Goncharov has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/72430 )
Change subject: dummyflasher: fix propagation of register_*_master() return values ......................................................................
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 --- M dummyflasher.c 1 file changed, 22 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/30/72430/1
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 = {